Skip to content

Configuration

Zhamri Che Ani edited this page Mar 6, 2019 · 15 revisions

How to:

List Git Configuration
$ git config --global --list


Add/Update User Name and Email

  $ git config --global user.name "Zhamri"
  $ git config --global user.email "[email protected]"

Update User Password

$ git config --global credential.helper osxkeychain
$ git push

You'll then be prompted for your password again.

Create/Update Alias

  $ git config --global alias.hist "log --oneline --graph --decorate --all"

Associating Text Editors with Git

Using TextMate as your editor

  $ git config --global core.editor "mate -w"

Using Atom as your editor

  $ git config --global core.editor "atom --wait"

  # For Windows users:
  $ git config --global core.editor "\"C:\Users\<your username>\AppData\Local\atom\atom.exe\""

Using Sublime Text as your editor

  $ git config --global core.editor "subl -n -w"

Using VS Code as your editor

  $ git config --global core.editor "code --wait"

Using Notepad++ as your editor

  # For Windows users:
  $ git config --global core.editor "\"c:\Program Files\Notepad++\notepad++.exe\""
  # or
  $ git config --global core.editor "\"c:\Program Files\Notepad++\notepad++.exe\" %*"

Test Git Default Editor

  $ git config --global -e

References:

  1. https://git-scm.com/docs/git-config
  2. https://help.github.com/articles/associating-text-editors-with-git/
  3. http://www.sublimetext.com/docs/3/osx_command_line.html
  4. https://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows
  5. https://stackoverflow.com/questions/20195304/how-do-i-update-the-password-for-git