Last active
December 15, 2015 13:49
-
-
Save gsomoza/5270172 to your computer and use it in GitHub Desktop.
Useful Git Aliases
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
[alias] | |
# Usage: git nff {merge-branch} | |
# Checks out {merge-branch}, pulls, and merges recursively with the branch where this command was executed. | |
# In other words: it merges the current branch into {merge-branch}. | |
nff = !bash -c 'cb="$(git rev-parse --abbrev-ref HEAD)" && git checkout "$1" && git pull && git merge --no-ff $cb' - | |
# Usage: git cbranch | |
# Returns the name of the current branch | |
cbranch = rev-parse --abbrev-ref HEAD | |
# Usage: git pushall [branch] | |
# Pushes to all remotes. Pushes only "branch" if specified. | |
pushall = !bash -c 'git remote | xargs -I rem -n 1 bash -c \"echo \\\"> Pushing to rem\\\" && git push rem \"$1\" \"' - | |
# Usage: git pullall | |
# Pulls from all remotes | |
pullall = !bash -c 'git remote | xargs -I rem -n 1 bash -c \"echo \\\"> Pulling from rem\\\" && git pull rem\"' - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment