11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basic UsageLog message unchanged or not specified(a)bort, (c)ontinue, (e)dita$The repository doesn't know or care whether your changes make any sense as a whole; itchecks only to make sure nobody else has changed any of the same files that you didwhen you weren't looking. If somebody has done that, the entire commit will fail <strong>with</strong> amessage informing you that one or more of your files are out of date:$ svn commit -m "Add another rule"Sending rules.txtsvn: Commit failed (details follow):svn: File '/sandwich.txt' is out of date…(The exact wording of this error message depends on the network protocol and serveryou're using, but the idea is the same in all cases.)At this point, you need to run svn update, deal <strong>with</strong> any merges or conflicts that result,and attempt your commit again.That covers the basic work cycle for using <strong>Subversion</strong>. <strong>Subversion</strong> offers many other featuresthat you can use to manage your repository and working copy, but most of your dayto-dayuse of <strong>Subversion</strong> will involve only the commands that we've discussed so far in thischapter. We will, however, cover a few more commands that you'll use fairly often.Examining HistoryYour <strong>Subversion</strong> repository is like a time machine. It keeps a record of every change evercommitted and allows you to explore this history by examining previous versions of filesand directories as well as the metadata that accompanies them. With a single <strong>Subversion</strong>command, you can check out the repository (or restore an existing working copy) exactlyas it was at any date or revision number in the past. However, sometimes you just want topeer into the past instead of going into it.Several commands can provide you <strong>with</strong> historical data from the repository:svn logShows you broad information: log messages <strong>with</strong> date and author information attachedto revisions and which paths changed in each revisionsvn diffShows line-level details of a particular changesvn catRetrieves a file as it existed in a particular revision number and displays it on yourscreensvn listDisplays the files in a directory for any given revisionGenerating a List of Historical ChangesTo find information about the history of a file or directory, use the svn log command. svn33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!