Last active
March 28, 2022 12:54
Star
You must be signed in to star a gist
Useful git aliases
This file contains 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
[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