Created
April 28, 2015 12:25
-
-
Save oakfang/af59c0c82604db22c590 to your computer and use it in GitHub Desktop.
Git commands to make life easier
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
# Show all commits of current branch since its beginning | |
# Add flags as though it were git log | |
git log $(git parent)..HEAD $* |
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
# Show current branch name | |
git rev-parse --abbrev-ref HEAD |
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
# Show all branches prettily according to git flow | |
git branch --list --no-color $1 | tr -d '* ' | perl -pe 's/feature\//\e[0;32mFeature: \e[0m/' | perl -pe 's/bug\//\e[0;31mBug: \e[0m/' | perl -pe 's/release\//\e[0;36mRelease: \e[0m/' | perl -pe 's/(develop|master)/\e[46m\1\e[0m/' |
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
# Rebase side branch to another side branch (such as a release branch) | |
# If you use this, you're probably patching something :( | |
git rebase --onto $1 $(git parent) $(git current) |
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
# Show persumed parent branch of current branch | |
branch=`git current` | |
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment