Created
November 5, 2015 12:34
-
-
Save gonchar/93ae2a08796f4719f531 to your computer and use it in GitHub Desktop.
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] | |
# full status | |
rstatus = !sh -c 'git status -sb --ignore-submodules=dirty && git submodule foreach --recursive git status -sb --ignore-submodules=dirty' - | |
rstatus-no-subs = !sh -c 'git status -sb --ignore-submodules=all && git submodule foreach --recursive git status -sb --ignore-submodules=all' - | |
s = !sh -c 'git rstatus-no-subs' - | |
# fetches all modules | |
rfetch = !sh -c 'git fetch && git submodule foreach --recursive git fetch' - | |
# updates project and all submodules | |
r-fetch-pull-merge = !sh -c 'git rfetch && git submodule foreach --recursive git merge && git merge && git s' - | |
r-fetch-pull-rebase = !sh -c 'git rfetch && git submodule foreach --recursive git rebase && git rebase && git s' - | |
up = !sh -c 'git r-fetch-pull-rebase' - | |
# recursive push | |
rpush = !sh -c 'git submodule foreach --recursive git push && git push' - | |
pushall = push --recurse-submodules=on-demand | |
out = !sh -c 'git rpush' - | |
# recurisive checkout and pull | |
switch = !sh -c 'git submodule foreach --recursive git checkout $1 && git checkout $1' - | |
# merge branches | |
merge-branch-from-to = !sh -c 'echo "will merge $1 to $2" && git fetch && git checkout $1 && git rebase && git checkout $2 && git rebase && git merge $1 -m merge && git push && echo done' - | |
merge-branch-from-to-no-fetch = !sh -c 'echo "will merge $1 to $2" && git checkout $1 && git rebase && git checkout $2 && git rebase && git merge $1 -m merge && git push && echo done' - | |
bft = !sh -c 'git merge-branch-from-to $1 $2' - | |
rbft = !sh -c 'git rfetch && git submodule foreach --recursive git merge-branch-from-to-no-fetch $1 $2 && git merge-branch-from-to-no-fetch $1 $2 && git s' - | |
merge-branch-from-to-no-commit = !sh -c 'echo "will dry merge $1 to $2" && git fetch && git checkout $1 && git rebase && git checkout $2 && git rebase && git merge $1 --no-commit --no-ff && echo done' - | |
merge-branch-from-to-no-commit-no-fetch = !sh -c 'echo "will dry merge $1 to $2" && git checkout $1 && git rebase && git checkout $2 && git rebase && git merge $1 --no-commit --no-ff && echo done' - | |
safebft = !sh -c 'git merge-branch-from-to-no-commit $1 $2' - | |
rsafebft = !sh -c 'git rfetch && git submodule foreach --recursive git merge-branch-from-to-no-commit-no-fetch $1 $2 && git merge-branch-from-to-no-commit-no-fetch $1 $2 && git s' - | |
rnew-branch = !sh -c 'git submodule foreach --recursive git checkout -b $1 && git submodule foreach --recursive git push -u && git checkout -b $1 && git push -u' - | |
# tag | |
rtag = !sh -c 'git submodule foreach --recursive git tag -a $1 -m $1 && git tag -a $1 -m $1 && git submodule foreach --recursive git push --tags && git push --tags' - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment