Last active
September 13, 2022 10:48
-
-
Save guysmoilov/24b00c1a16079887a870ffe9ebd0472b to your computer and use it in GitHub Desktop.
My git aliases. Work in progress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
br = branch | |
sh = show | |
rb = rebase | |
rbi = rebase -i | |
st = status | |
ci = commit | |
cim = commit -m | |
cia = commit -a -m | |
co = checkout | |
rs = reset | |
uncommit = reset --soft HEAD~1 | |
rollback = reset --hard HEAD~1 | |
conf = config | |
gconf = config --global | |
mrg = merge | |
cln = clone | |
clnossl = clone -c http.sslVerify=false | |
nossl = conf http.sslVerify false | |
graph = log --graph --oneline | |
graphall = log --graph --oneline --all | |
mvbr = branch -f | |
shbr = rev-parse --abbrev-ref HEAD | |
psh = push | |
pshu = push -u | |
pushu = push -u | |
ad = add | |
amend = commit --amend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
git add . | |
git commit -am "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: Put git-pshbr somewhere in your PATH, then use it like so: | |
# git pshbr [remote] | |
# Will push the branch you're currently on to a new branch with the same name on origin, and set the local branch to track it | |
git push -u ${1:-origin} $(git shbr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: git pullco branchname [origin] | |
# Will fetch from origin, move the local branch to the new commit fetched from origin, and then check it out | |
set -e | |
REMOTE=${2:-origin} | |
git fetch "$REMOTE" | |
git mvbr "$1" "$REMOTE/$1" | |
git checkout "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment