Changes between Version 1 and Version 2 of CaffeinatedSubversion
- Timestamp:
- 01/18/11 12:25:12 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CaffeinatedSubversion
v1 v2 1 1 This page is intended to explain enough about Subversion to work with the Debathena repository. For more information on Subversion, see O'Reillys "Version Control with Subversion", available at [http://svnbook.red-bean.com/], or though the MIT Libraries' subscription to [http://libraries.mit.edu/get/safari Safari (Touchstone authentication required)] 2 2 3 == Getting started==3 == Getting started == 4 4 5 5 Normally, you would use the Subversion URL `svn+ssh://svn.mit.edu/athena/trunk` to work with Subversion. However, this requires write access to the repository. If you don't have write access, you'll only be able to check out the code, not commit anything, and you'd use the URL `svn://debathena.mit.edu/athena/trunk` instead. … … 7 7 Changes in subversion are identified with revision numbers (e.g. r12345). This revision number applies to the entire repository, even though the actual change likely only affected a few files. 8 8 9 == Initial checkout==9 == Initial checkout == 10 10 11 11 Identify a location in your filesystem for your working copy of the source, and change to that directory. Then, checkout the source with the following command: … … 14 14 This will create a directory called `athena` in the current directory, with the Athena source tree inside that directory. That directory is called a *working copy*. 15 15 16 == Getting an update from the server==16 == Getting an update from the server == 17 17 18 18 Before making changes, you'll want to ensure you have the latest copy of the code. `svn update` will get you the latest copy of the code. … … 27 27 In this example, foo.c is a new file, bar.c was changed ("updated"), and baz.c was deleted. It's possible you'll encounter conflicts at some point, but that will be covered later. 28 28 29 == Making changes==29 == Making changes == 30 30 31 31 Most text editors are aware of when you're editing files inside a working copy. Emacs, for example, won't create "twiddle files" (`filename~`) because it assumes Subversion will keep track of your changes. 32 32 33 === Adding or removing files===33 === Adding or removing files === 34 34 35 35 If you create new files or directories, you'll need to ensure Subversion is aware of them. You can wait until just prior to the commit to do this, or you can do it as you go. To add files or directories use `svn add`: … … 45 45 `svn del subdir` 46 46 47 == Reviewing your changes==47 == Reviewing your changes == 48 48 49 49 To view information about what files have been changed, use `svn status`. By default, it will display status on the current location in the repository, or you can specify a directory or file, or with no arguments … … 62 62 In this example, bar.c has been changed and will be committed. foo.c is a new file, which has been added with `svn add`, and quux.c has been deleted with `svn del`. The directory `subdir` exists in the filesystem, but is not under version control. If it's part of the package, you'll need to add it with `svn add`. The file `baz.c` should exist, but doesn't. If you delete a file with `rm`, you'll also need to `svn del` the file so Subversion knows it's gone. Additional information about the output format of `svn status` is available in the documentation, or with `svn help status`. 63 63 64 === Diffs===64 === Diffs === 65 65 66 66 If you want actual diffs, you can use the `svn diff` command. Like `svn status`, it can take optional file specifiers, or display all diffs. 67 67 68 == Reverting changes==68 == Reverting changes == 69 69 70 70 If you realize that you didn't want to make changes, you can revert a file's changes. Without any arguments, `svn revert` will revert your entire working copy, and won't ask for confirmation, so use it with care. … … 72 72 `svn revert foo.c` 73 73 74 == Committing your Changes==74 == Committing your Changes == 75 75 76 76 Before committing, make sure your working copy is up to date with `svn update`. … … 85 85 ^(That's two single-quotes, i.e. an empty string)^ 86 86 87 === Reverting a commit===87 === Reverting a commit === 88 88 89 89 If you want to revert a commit that you've already made, you can't use `svn revert`. Instead, you need to merge the changes back in to the current working copy, and then re-commit it.