Last active
June 30, 2025 15:17
-
-
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
# Allows you to run commands as "g st" etc. | |
# IMO this is preferable to making aliases like "alias gst=git status" since this way ALL your git commands will be fast | |
alias g="git" |
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 | |
# Usage: git mvbr branch-name target-ref | |
mvbr = branch -f | |
# Shows name of currently checked out branch (with no additional cruft) | |
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 | |
# Put this file in your PATH to be available as "git cia" | |
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 | |
# Put this file in your PATH to be available as "git pullco" | |
# 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