Created
August 2, 2011 09:26
-
-
Save afa/1119884 to your computer and use it in GitHub Desktop.
git workflow usage from sandofsky@t article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Maybe my feature branch existed for a very long time, and I had to merge several branches into my feature branch to keep it up to date while I work. History is convoluted. It’s easiest to grab the raw diff create a clean branch. | |
git checkout master | |
git checkout -b cleaned_up_branch | |
git merge --squash private_feature_branch | |
git reset | |
#I now have a working directory full of my changes and none of the baggage from the previous branch. Now I manually add and commit my changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cleaning history on long living branch | |
git rebase --interactive master | |
#in editor look: | |
pick ccd6e62 Work on back button | |
pick 1c83feb Bug fixes | |
pick f9d0c33 Start work on toolbar | |
#change must-be-squashed commits action to squash | |
pick ccd6e62 Work on back button | |
squash 1c83feb Bug fixes | |
pick f9d0c33 Start work on toolbar | |
#after save - message for joined commit will be asked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b private_feature_branch | |
touch file1.txt | |
git add file1.txt | |
git commit -am "WIP" | |
#When I’m done, instead of a vanilla git merge, I’ll run: | |
git checkout master | |
git merge --squash private_feature_branch | |
git commit -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment