Changes for page Getting Started with Git
Last modified by Bastian Triller on 2013/05/21 17:24
From version 126.1
edited by Kieran Kelleher
on 2011/03/21 15:30
on 2011/03/21 15:30
Change comment:
There is no comment for this version
To version 147.1
edited by Kieran Kelleher
on 2011/03/21 15:57
on 2011/03/21 15:57
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -50,3 +50,44 @@ 50 50 * Merge your working branch(es) with or rebase your working branch(es) from the master and just keep on working. 51 51 * Switch to master branch before synchronizing with remote svn repo. 52 52 * You can use ##git stash## to temporarily put aside your uncommitted changes before doing an svn update. Then use ##git stash pop## to replay those uncommitted changes onto the working copy. 53 + 54 +{{info title="Anatomony of an svn update operation on a git-managed svn working copy"}} 55 + 56 +{noformat} 57 +# Assume you are currently on a working branch. Verify this and check for uncommitted changes. 58 +git status 59 + 60 +# Either commit your local changes to your working branch using {{git add}} + {{git commit}}, or temporarily stash them using {{git stash}} 61 +git stash 62 + 63 +# Switch to master branch 64 +git checkout master 65 + 66 +# Ensure there are no changes either from an svn perspective or a git perspective on the master branch. 67 +git status 68 +svn status 69 + 70 +# Update the master branch from remote svn repo 71 +svn update 72 + 73 +# Commit those updates to git repo 74 +git commit -a -m "updated from remote svn repo" 75 + 76 +# Switch to your working branch 77 +git checkout workingbranch 78 + 79 +# Merge or rebase your working branch off of the updated master. 80 +# This rewinds your branch commits back to the common commit ancestor 81 +# shared between your working branch and the master branch. Then it 82 +# applies the master branch commits (the svn updates) so that this 83 +# working branch becomes identical to the master. After that it 'replays' 84 +# your working branch commits on top of the updated branch. 85 +# This ensures a clean linear progression. Rebasing is a very cool feature of git. 86 +rebase master 87 + 88 +# Now if you stashed uncommitted changes earlier, you can pop them back into 89 +# the working copy 90 +git stash pop 91 +{noformat} 92 + 93 +{{/info}}