Skip to content

Instantly share code, notes, and snippets.

@diegomais
Last active February 20, 2023 20:47
Show Gist options
  • Save diegomais/e5d428f3359941e739baa574a598f542 to your computer and use it in GitHub Desktop.
Save diegomais/e5d428f3359941e739baa574a598f542 to your computer and use it in GitHub Desktop.
Set Git global options
[color]
ui = true
[color "branch"]
current = white
remote = red
[color "diff"]
meta = yellow
old = red
new = green
[color "status"]
added = green
changed = yellow
untracked = red
[commit]
template = ~/.gitmessage
[core]
editor = code --wait
excludesFile = ~/.gitignore
[init]
defaultBranch = main
[push]
autoSetupRemote = true
[alias]
s = status -s
st = status -sb
sf = show --name-only
l = log --pretty=format:'%C(blue)%h%C(red)%d %C(white)%s - %C(cyan)%cn, %C(green)%cr'
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
rollforward = commit -c ORIG_HEAD
conflicts = !git ls-files -u | cut -f 2 | sort -u
save = !git add -A && git commit -n -m 'wip: save point'
# <type>(<scope>): <summary> (this commit will...)
# |<---- Preferably using up to 50 chars --->|<--- Max 72 char --->|
# Remember blank line between title and body.
# (Optional) Explain *what* and *why* (not *how*)
# |<---- Try to limit each line to a maximum of 72 characters ---->|
# (Optional) Provide links to any relevant tickets, articles or other resources
# Example: Closes #10
# --- COMMIT END ---
# Type must be one of the following:
# fix : A bug fix. Correlates with PATCH in SemVer
# feat : A new feature. Correlates with MINOR in SemVer
# docs : Documentation only changes
# style : Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
# refactor: A code change that neither fixes a bug nor adds a feature
# perf : A code change that improves performance
# test : Adding missing or correcting existing tests
# build : Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)
# ci : Changes to our CI configuration files and scripts (example scopes: GitLabCI)
# ------------------
# What is the scope of this change? (domain or class or file name)
# ------------------
# Remember to:
# * use the imperative, present tense: "change" not "changed" nor "changes"
# * don't capitalize first letter in the summary line
# * don't end the summary line with a period
# * can use multiple lines with "-" or "*" for bullet points in body
# ------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment