Skip to content

Instantly share code, notes, and snippets.

@kjr247
Last active March 28, 2023 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjr247/1c26edf9a5fc9d55b7e3330d4b4750ad to your computer and use it in GitHub Desktop.
Save kjr247/1c26edf9a5fc9d55b7e3330d4b4750ad to your computer and use it in GitHub Desktop.
git aliases
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Kyle Rebstock
email = kjr247@gmail.com
[alias]
a = !git add . && git status
alia = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
amend = !git commit —amend
ac = !git add . && git commit -m
acf = !git add . && git commit -m ":zap:" && git commit --amend
acd = !git add . && git commit -m ":pencil: docs" && git commit --amend
ach = !git add . && git commit -m ":fire: hotfix" && git commit --amend
c = commit -m
co- = checkout -
coback = checkout -
cod = !git checkout development && git pull origin development
com = !git checkout main && git pull origin main
comb = !git checkout main && git pull origin main && git checkout -b
codb = !git checkout development && git pull origin development && git checkout -b
cob = checkout -b
day = log --pretty=oneline --since=1.days
done = !git fetch && git rebase origin/development && git push
donemast = !git fetch && git rebase origin/main && git push
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
f = !git fetch origin && git s
pull = !git pull origin && git status
push = !git push origin && git status
s = status
createrelease = "!f() { git checkout main; git pull origin main; git branch release/$(date +%Y-%m-%d); git checkout release/$(date +%Y-%m-%d); git tag -a release/$(date +%Y-%m-%d) -m ""; git push release/$(date +%Y-%m-%d); }; f"
crr = "!f() { git checkout main; git pull origin main; git checkout -b release/${1}; git tag -a ${2} -m {1}; git push origin release/${1}; }; f" #${1} newBranchName ${2} tagName
crh = "!f() { git checkout ${1}; git pull origin ${1}; git checkout -b release/${2}; git tag -a ${3} -m {2}; git push origin release/${1}; }; f" #${1} targetBranchName ${2} newHotfixName ${3} tagName
rmb = branch -D
rmbr = "!f() { echo "deleting refs from remote ${1}"; git push origin --delete refs/heads/{1}; }; f"
showtag = tag
t = tag -a #Param tagName
utag = tag -d #Param tagName
utagp = push --delete origin #Param tagName
frdev = !git fetch origin && git rebase origin/development && git status
frmast = !git fetch origin && git rebase origin/main && git status
undo = !git stash && git reset --hard HEAD~1
st = stash
[core]
editor = code --wait
@kjr247
Copy link
Author

kjr247 commented Mar 28, 2023

git config --global core.editor "code --wait"

// open directly with favorite editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment