Skip to content

Instantly share code, notes, and snippets.

@CodelineRed
Last active October 3, 2024 18:01
Show Gist options
  • Save CodelineRed/a5f2b195af4ef6609c325c97d018e476 to your computer and use it in GitHub Desktop.
Save CodelineRed/a5f2b195af4ef6609c325c97d018e476 to your computer and use it in GitHub Desktop.
List of Git alias
[user]
name = John Doe
email = john@doe.git
[init]
defaultBranch = main
[credential]
helper = manager
[core]
autocrlf = true
[alias]
aa = add .
al = "!git config --get-regexp ^alias\\."
br = branch
co = checkout
cod = checkout develop
com = checkout master
comn = checkout main
cop = checkout production
co1 = checkout 1.x
co2 = checkout 2.x
co3 = checkout 3.x
co4 = checkout 4.x
co5 = checkout 5.x
co6 = checkout 6.x
co7 = checkout 7.x
co8 = checkout 8.x
co9 = checkout 9.x
co10 = checkout 10.x
cm = "!f() { git commit -m \"$1\"; }; f"
cmr = "!f() { git commit -m \"Release $1\"; }; f"
cmb = "!f() { git commit -m \"Production Build $1\"; }; f"
cmp = "!f() { git commit -m \"Production Build $1\"; }; f"
fa = fetch --all
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
mrg = merge
mrgd = merge develop
mrgm = merge master
mrgmn = merge main
mrg1 = merge 1.x
mrg2 = merge 2.x
mrg3 = merge 3.x
mrg4 = merge 4.x
mrg5 = merge 5.x
mrg6 = merge 6.x
mrg7 = merge 7.x
mrg8 = merge 8.x
mrg9 = merge 9.x
mrg10 = merge 10.x
p = push
pf = push --force-with-lease
pl = pull
po = "!f() { git push origin develop $1 master production; }; f"
po2 = "!f() { git push origin develop $1 main production; }; f"
pt = push --tags
rsh = "!f() { git reset origin/$1; git reset --hard HEAD; }; f"
rss = "!f() { git stash -u; git stash drop; }; f"
st = status
t = "!f() { git tag $1; }; f"
td = "!f() { git tag -a $1 -m \"See CHANGELOG.md\"; }; f"
tf = "!f() { git tag -a $1 -m \"See CHANGELOG.md and UPGRADE.md\"; }; f"
tls = tag -n
tm = "!f() { git tag -a $1 -m \"$2\"; }; f"
trm = "!f() { git tag -d $1; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment