Posted almost 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.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Author of this card:

Avatar
Martin Straub
Last edit:
3 months ago
by Henning Koch
Keywords:
config
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Martin Straub to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more