Last active
January 15, 2017 02:12
-
-
Save hugolu/150f629dd52f9ec469895dbaa10d438f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# init repository | |
rm -rf learn-git | |
mkdir learn-git | |
cd learn-git | |
git init | |
# commit changes | |
echo 1 >> file | |
git add . | |
git commit -m "1" | |
echo 2 >> file | |
git commit -am "2" | |
# show commit log | |
git log | |
git log --pretty=oneline | |
git log --oneline | |
# create branch | |
git branch dev | |
git branch | |
# switch branch to dev | |
git checkout dev | |
git branch | |
# commit changes | |
echo 3 >> file | |
git commit -am "3" | |
# switch branch to master | |
git checkout master | |
git log --oneline | |
git log --oneline --all | |
# merge branch (fast-forward) | |
git merge dev | |
git log --oneline | |
# delete branch | |
git branch -d dev | |
git branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment