Files
nixos-setup/modules/skyg/gitconfigs/alias.conf
T
2024-08-09 13:20:45 -04:00

33 lines
848 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";