Skip to content

Instantly share code, notes, and snippets.

@yanky2000
Created February 9, 2025 13:09
Show Gist options
  • Save yanky2000/6f494371f0e91318aa70b4edc20e84da to your computer and use it in GitHub Desktop.
Save yanky2000/6f494371f0e91318aa70b4edc20e84da to your computer and use it in GitHub Desktop.
gitconfig
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
# name = ***
# email = ****
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
cm = commit -m
aacm = !git add -A . && git commit
aacm = !git add -A . && git commit -m
cp = cherry-pick
amend = commit --amend -m
dev = !git checkout dev && git pull origin dev
staging = !git checkout staging && git pull origin staging
main = !git checkout main && git pull origin
master = !git checkout master && git pull origin
po = push origin
pu = !git push origin `git branch --show-current`
pod = push origin dev
pos = push origin staging
pom = push origin main
poh = push origin HEAD
pogm = !git push origin gh-pages && git checkout master && git pull origin master && git rebase gh-pages && git push origin master && git checkout gh-pages
pomg = !git push origin master && git checkout gh-pages && git pull origin gh-pages && git rebase master && git push origin gh-pages && git checkout master
plo = pull origin
plod = pull origin dev
plos = pull origin staging
plom = pull origin main
ploh = pull origin HEAD
unstage = reset --soft HEAD^
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
f = "!git ls-files | grep -i"
gr = grep -Ii
la = "!git config -l | grep alias | cut -c 7-"
[core]
editor = code --wait
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[init]
defaultBranch = main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment