11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic UsageMortadellaProsciutto=======The text between the second and third sets of conflict markers is the text from Sally's commit:=======SauerkrautGrilled Chicken>>>>>>> .r2Usually you won't want to just delete the conflict markers and Sally's changes—she's goingto be awfully surprised when the sandwich arrives and it's not what she wanted. This iswhere you pick up the phone or walk across the office and explain to Sally that you can'tget sauerkraut from an Italian deli. 3 Once you've agreed on the changes you will commit,edit your file and remove the conflict markers:Top piece of breadMayonnaiseLettuceTomatoProvoloneSalamiMortadellaProsciuttoCreole MustardBottom piece of breadNow use svn resolve, and you're ready to commit your changes:$ svn resolve --accept working sandwich.txtResolved conflicted state of 'sandwich.txt'$ svn commit -m "Go ahead and use my sandwich, discarding Sally's edits."Note that svn resolve, unlike most of the other commands we deal <strong>with</strong> in this chapter, requiresthat you explicitly list any filenames that you wish to resolve. In any case, you wantto be careful and use svn resolve only when you're certain that you've fixed the conflict inyour file—once the temporary files are removed, <strong>Subversion</strong> will let you commit the fileeven if it still contains conflict markers.If you ever get confused while editing the conflicted file, you can always consult the threefiles that <strong>Subversion</strong> creates for you in your working copy—including your file as it was beforeyou updated. You can even use a third-party interactive merging tool to examine thosethree files.Discarding your changes in favor of a newly fetched revisionIf you get a conflict and decide that you want to throw out your changes, you can run svnresolve --accept theirs-full CONFLICTED-PATH and <strong>Subversion</strong> will discardyour edits and remove the temporary files:$ svn updateConflict discovered in 'sandwich.txt'.Select: (p) postpone, (df) diff-full, (e) edit,3 And if you ask them for it, they may very well ride you out of town on a rail.31

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

Saved successfully!

Ooh no, something went wrong!