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