feat: add gitconfig settings to dots
This commit is contained in:
parent
0d2a8d0c6e
commit
f0ed8873f6
2 changed files with 46 additions and 0 deletions
32
git/aliases.gitconfig
Normal file
32
git/aliases.gitconfig
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue