Posted about 8 years ago. Visible to the public.

Git configuration

Git can be configured in ~/.gitconfig. Here is an overview about common configurations:

Author name

To appear with your name in commits:

Copy
[user] name = Your Name email = your.name@domain.de

Colors

Copy
[color] ui = auto # The value for these configuration variables is a # list of colors (at most two) and attributes (at # most one), separated by spaces. # The colors accepted are: # normal, black, red, green, yellow, blue, magenta, cyan and white # The attributes are: # bold, dim, ul, blink and reverse # # The first color given is the foreground; the second # is the background. The position of the attribute, # if any, doesn’t matter. [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"] whitespace = white reverse meta = blue reverse frag = blue reverse old = red new = green [color "status"] added = green changed = yellow untracked = cyan

Handy aliases

Please only use an alias if you understand what it does.

Copy
[alias] amend = commit -v --amend # Amend changes to last commit c = commit -v -m # Commit with message from command line, usage: git c "commit message" lc = show --name-status # Show last commit lou = log --oneline @{u}.. # List unpushed commits uncommit = reset HEAD~ --soft riu = rebase -i @{u} # Interactive rebase against upstream du = diff @{u} # Diff against upstream

"Upstream" is the branch on origin where your current local branch is pulling from and pushing to.

Owner of this card:

Avatar
Martin Straub
Last edit:
about 1 month ago
by Andreas Herz
Keywords:
config
Posted by Martin Straub to makandra orga & processes
This website uses cookies to improve usability and analyze traffic.
Accept or learn more