Skip to content

Instantly share code, notes, and snippets.

@frontrangerider2004
Created March 15, 2023 17:44
Show Gist options
  • Select an option

  • Save frontrangerider2004/abfee49d53f6bd688af43350de00d540 to your computer and use it in GitHub Desktop.

Select an option

Save frontrangerider2004/abfee49d53f6bd688af43350de00d540 to your computer and use it in GitHub Desktop.
Good .gitconfig setup with aliases
[commit]
gpgsign = true
[tag]
gpgsign = true
[gpg]
format = ssh
[user]
# Need to add signing key for ssh to work
# signingkey =
email = [email protected]
name = Frontrangerider
#[gpg "ssh"]
# allowedSignersFile = /Users/jason.gerensimplesense.io/.ssh/allowed_signers
[credential]
helper = store
[merge]
tool = meld
[mergetool]
prompt = false
[mergetool "meld"]
trustExitCode = true
cmd = open -W -a Meld --args --auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\"
[diff]
tool = vscode
[difftool]
prompt = false
[difftool "vscode"]
cmd = "code --wait --diff ${LOCAL} ${REMOTE}"
[init]
defaultBranch = main
[pull]
rebase = true
[alias]
# Show graph log with author and timestamp
lg = log --all --graph --pretty=format:'%C(auto)%h%d %s %C(bold black)(%ar by <%aN>)%Creset'
# Show commits on feature branch and where the feature was created.
# @param refs - Use rev-list .. or ... comparison operators like HEAD..dev or HEAD...dev
lgb = log --oneline --boundary
# Count commits on feature branch. Useful for rebasing. Can be combined with --boundary
# @param refs - Use rev-list .. or ... comparison operators like HEAD..dev or HEAD...dev
count = rev-list --count
# Rename a branch. Make sure you have the old branch checked out
# @param new_name
rename = "!f() { \
local old_name=$(git name-rev --name-only HEAD); \
local new_name=$1; \
git branch -m ${new_name}; \
git push origin -u ${new_name}; \
git push origin --delete ${old_name}; \
}; f"
# Cleanup deleted branches
prune = fetch --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment