Last active
January 15, 2017 02:13
-
-
Save hugolu/e2c88ddd18d0719f3f48dfc883130a71 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 @master | |
echo 1 >> file | |
git add . | |
git commit -m "1" | |
echo 2 >> file | |
git commit -am "2" | |
# create branch and change to it | |
git checkout -b dev | |
# commit changes @dev | |
echo 3 >> file | |
git commit -am "3" | |
# switch branch | |
git checkout master | |
# commit changes @master | |
echo 4 >> file | |
git commit -am "4" | |
# merge branch | |
git merge dev | |
# fix conflict | |
sed -i '' -e "/<<<<<<</d" -e "/=======/d" -e "/>>>>>>>/d" file | |
git commit -am "fix conflict" | |
# show log | |
git log --oneline --graph --all | |
# delete branch | |
git branch -d dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment