Skip to content

Instantly share code, notes, and snippets.

@joeoravec
Forked from nepsilon/a-better-setup-for-git.md
Created May 4, 2016 13:37
Show Gist options
  • Select an option

  • Save joeoravec/e1cb48cfb7cefbd856e0d816b6cdf24a to your computer and use it in GitHub Desktop.

Select an option

Save joeoravec/e1cb48cfb7cefbd856e0d816b6cdf24a to your computer and use it in GitHub Desktop.

Revisions

  1. @nepsilon nepsilon created this gist Apr 29, 2016.
    42 changes: 42 additions & 0 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    # The basics, who you commit as:
    [user]
    name = John Doe
    email = [email protected]
    # Your Github username
    [github]
    user = githubusername
    # Some aliases to save 1000s keystrokes each year:
    [alias]
    log = log --color
    co = checkout
    br = branch
    ci = commit
    st = status
    # Long but worth it, gives you output like:
    # * 4be77ea Add issue 42. 4 weeks ago by Julien
    lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen%ar%Creset by %C(yellow)%an%Creset' --abbrev-commit
    # Convenient to see diff in minified files
    dw = diff --color-words
    # Add colors
    [color]
    ui = true
    diff = auto
    # Avoid messy merge commits with autorebase
    [branch]
    autosetuprebase = always
    # Push the current branch by default
    [push]
    default = current
    # Guess what you really meant
    [help]
    autocorrect = 1
    # Tell git you have a global .gitignore
    [core]
    excludesfile = ~/.gitignore
    # Remove usage hints
    [advice]
    statusHints = false
    # Tell where are the diff from,
    # instead of using a and b notation
    [diff]
    mnemonicprefix = true