35 lines
955 B
Plaintext
35 lines
955 B
Plaintext
[alias]
|
|
pp = "!f() { \
|
|
echo 'git pull --ff';\
|
|
git pull --ff; \
|
|
echo 'git push';\
|
|
git push; \
|
|
}; f";
|
|
up = "pull --rebase --autostash";
|
|
ca = "commit -a";
|
|
ls = "log --oneline";
|
|
cap = "!f() { \
|
|
echo 'commiting code'; \
|
|
git ca ${@}; \
|
|
echo 'pushing...'; \
|
|
git push ; \
|
|
}; f";
|
|
undo-commit = "!f() { \
|
|
lastcommit=$(git log --oneline -n 1); \
|
|
echo '[[switching]] from' $lastcommit; \
|
|
git reset --soft HEAD~${1:-1}; \
|
|
lastcommit=$(git log --oneline -n 1); \
|
|
echo '[[switching]] to' $lastcommit; \
|
|
git status; \
|
|
}; f";
|
|
sync = "!f() { \
|
|
target_branch=${1:-main}; \
|
|
remote=${2:-origin}; \
|
|
git fetch $remote $target_branch:$target_branch; \
|
|
}; f";
|
|
clean-branches = "!f() { \
|
|
git for-each-ref --format '%(refname:short)' refs/heads| grep -v 'master\\|main' | xargs git branch -D ; \
|
|
}; f";
|
|
aliases = "!f() { \
|
|
git config --get-regexp alias | awk '{print $1}' | sed 's/alias\\./ - /' ; \
|
|
}; f"; |