Changes for page Getting Started with Git

Last modified by Bastian Triller on 2013/05/21 17:24

From version 125.1
edited by Kieran Kelleher
on 2011/03/21 15:30
Change comment: There is no comment for this version
To version 149.1
edited by Kieran Kelleher
on 2011/03/21 16:00
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -50,3 +50,46 @@
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 +{{code title="Anatomony of an svn update operation on a git-managed svn working copy"}}
55 +
56 +
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
61 +# using {{git add}} + {{git commit}}, or temporarily stash
62 +# them using {{git stash}}
63 +git stash
64 +
65 +# Switch to master branch
66 +git checkout master
67 +
68 +# Ensure there are no changes either from an svn perspective
69 +# or a git perspective on the master branch.
70 +git status
71 +svn status
72 +
73 +# Update the master branch from remote svn repo
74 +svn update
75 +
76 +# Commit those updates to git repo
77 +git commit -a -m "updated from remote svn repo"
78 +
79 +# Switch to your working branch
80 +git checkout workingbranch
81 +
82 +# Merge or rebase your working branch off of the updated master.
83 +# This rewinds your branch commits back to the common commit ancestor
84 +# shared between your working branch and the master branch. Then it
85 +# applies the master branch commits (the svn updates) so that this
86 +# working branch becomes identical to the master. After that it 'replays'
87 +# your working branch commits on top of the updated branch.
88 +# This ensures a clean linear progression. Rebasing is a very cool feature of git.
89 +rebase master
90 +
91 +# Now if you stashed uncommitted changes earlier, you can pop them back into
92 +# the working copy
93 +git stash pop
94 +
95 +{{/code}}