Skip to content

Instantly share code, notes, and snippets.

@thomaslevesque
Last active March 28, 2022 12:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save thomaslevesque/24fd902a2b658c2cec95 to your computer and use it in GitHub Desktop.
Useful git aliases
[repo]
defaultRemoteName = origin
mainBranchName = master
[alias]
diffc = diff --cached
logg1 = log --graph --oneline
current-branch = rev-parse --abbrev-ref HEAD
publish = !git push -u $(git config repo.defaultRemoteName) $(git current-branch)
finish-branch = !branchName=$(git current-branch) && git fetch $(git config repo.defaultRemoteName) $(git config repo.mainBranchName):$(git config repo.mainBranchName) && git checkout $(git config repo.mainBranchName) && git branch -d $branchName && git fetch -p $(git config repo.defaultRemoteName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment