feat: add gitconfig settings to dots

This commit is contained in:
hhhh hgfh 2026-09-29 13:04:10 +03:00
parent 0d2a8d0c6e
commit f0ed8873f6
2 changed files with 46 additions and 0 deletions

32
git/aliases.gitconfig Normal file
View file

@ -0,0 +1,32 @@
[alias]
st = status
sw = switch
br = branch
co = checkout
ci = commit
lg = log --graph --decorate --oneline --all
up = "!git switch master && git pull"
update-master = "!f() { \
branch=$(git branch --show-current) || exit 1; \
[ -n \"$branch\" ] || { echo 'Detached HEAD'; exit 1; }; \
git switch master && \
git pull && \
git switch \"$branch\"; \
}; f"
rebase-master = "!f() { \
branch=$(git branch --show-current) || exit 1; \
[ -n \"$branch\" ] || { echo 'Detached HEAD'; exit 1; }; \
[ \"$branch\" != \"master\" ] || { \
echo 'Already on master'; \
git pull; \
exit $?; \
}; \
git switch master && \
git pull && \
git switch \"$branch\" && \
git rebase master; \
}; f"