Created
November 25, 2016 04:14
-
-
Save praveen-krishn/d36974b77868851041b586aad9b130f0 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
| #!/bin/bash | |
| function seed { | |
| echo $1 >> $2; | |
| git add $2; | |
| git commit -m "$1"; | |
| } | |
| rm -rf .git | |
| git config --global core.editor vim | |
| git init | |
| seed m0 a | |
| seed m1 a | |
| seed m2 a | |
| git checkout -b experiment | |
| seed m4 b | |
| git checkout master | |
| seed m3 a | |
| seed m5 a | |
| clear | |
| echo "@ master" | |
| git log --oneline --abbrev-commit --all --graph --decorate --color | |
| git checkout experiment | |
| git rebase master | |
| echo "@ experiment" | |
| git log --oneline --abbrev-commit --all --graph --decorate --color | |
| git checkout master | |
| git merge experiment | |
| echo "@ master" | |
| git log --oneline --abbrev-commit --all --graph --decorate --color | |
| # to view from old commit | |
| # git checkout a1e8fb5 hello.py | |
| # to get latest commit | |
| # git checkout HEAD hello.py | |
| # git revert <commit> | |
| # git clean -df | |
| # git commit --amend --no-edit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment