-
-
Save adeak/53879d58c084b85e4bb1c5bcfdb8a5f9 to your computer and use it in GitHub Desktop.
git fast-forward example
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
# create repo | |
git init | |
# set up branch stuck_on_foo with a single commit | |
touch foo | |
git add foo | |
git commit -m 'foo' | |
git branch stuck_on_foo | |
# add another commit to master | |
touch bar | |
git add bar | |
git commit -m 'bar' | |
# go back to stuck_on_foo and merge master into it to witness a fast-forward | |
git checkout stuck_on_foo | |
#gittree is an alias I have for this from https://stackoverflow.com/a/35075021: | |
git log --all --oneline --graph --decorate --branches | |
git merge master # the fast-forward | |
git log --all --oneline --graph --decorate --branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment