Created
July 20, 2016 16:02
-
-
Save henrahmagix/deef25c2363308739a35b7fc9cb53dbb to your computer and use it in GitHub Desktop.
Git Presentation Demo: branches
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 init | |
echo 'start' > start.txt | |
git add start.txt | |
git commit --message 'Initial commit' | |
git log | |
# Make a new branch | |
git branch new | |
git branch | |
git log new | |
git log master | |
# Make a change on the new branch | |
git checkout new | |
echo 'changed' > start.txt | |
git commit --all --message 'Changed start.txt' | |
git log | |
git checkout master | |
git log | |
git branch --delete new # Won't let you because commits would be lost | |
git merge new | |
git branch --delete new # Allowed | |
git branch | |
git log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment