Skip to content

Instantly share code, notes, and snippets.

@deoren
Last active February 4, 2018 04:07
Show Gist options
  • Save deoren/45ff43d5c1d1abeb1042bbb2a52b9ca8 to your computer and use it in GitHub Desktop.
Save deoren/45ff43d5c1d1abeb1042bbb2a52b9ca8 to your computer and use it in GitHub Desktop.
Standard git config options

Standard git config options

Tips:

  • Use --global to set options globally (for all repos) for the current user.
  • Use --system (via sudo or su) to set options for all users.

TL;DR

  • git config --global core.editor "nano"
  • git config --global pull.ff "only"
  • git config --global merge.ff "only"
  • git config --global core.filemode false

Location of config files

For Windows, the global settings are saved in $env:USERPROFILE\.gitconfig.

Example:

[core]
	editor = nano
	filemode = false

Commit editor

git config --global core.editor "nano"

Merging/Pulling

  • git config pull.ff "only"
  • git config merge.ff "only"

This new default setting can be overridden with the --no-ff option for both commands.

Permission changes

Tell git to ignore the executable bit differences between the index and the working copy. This is enable to "enabled" or "true" by default and is a frequent source of minor problems related to script permissions.

  • git config core.filemode false

Display current options

  • local/repo: git config --local --list
  • global (user specific): git config --global --list
  • system (all users): git config --system --list
  • everything: git config --list
@deoren
Copy link
Author

deoren commented Jan 23, 2018

As of the time this Gist entry was created, GitHub does not support notifications for comments for mentions to Gist entries (see isaacs/github#21 for details). Please contact me via Twitter or file an issue in the deoren/leave-feedback repo (created for that very purpose) if you wish to receive a response for your feedback. Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment