Files
nixos-setup/configs/gitconfigs/alias.conf
T
2024-04-25 15:58:56 -04:00

29 lines
702 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";