Skip to content

Instantly share code, notes, and snippets.

@basedalexander
Last active February 21, 2018 07:09
Show Gist options
  • Save basedalexander/5d6530b6f709383eb922 to your computer and use it in GitHub Desktop.
Save basedalexander/5d6530b6f709383eb922 to your computer and use it in GitHub Desktop.
Config
* git config --global user.name <name>
* git config --global user.email <email>
* git config --global alias.<alias-name> <git-command> // Create a shortcut for a Git command.
* git config --system core.editor <editor> // Define the text editor used by commands
// like git commit for all users on the current machine.
// The <editor> argument should be the command that
// launches the desired editor (e.g., vi).
* git config --global --edit // Open the global configuration file in a text editor for manual editing.
Config stores :
* <repo>/.git/config – Repository-specific settings.
* ~/.gitconfig – User-specific settings. This is where options set with the --global flag are stored.
* $(prefix)/etc/gitconfig – System-wide settings.
Typical initial configuration :
# Tell Git who you are
git config --global user.name "John Smith"
git config --global user.email john@example.com
# Select your favorite text editor
git config --global core.editor vim
# Add some SVN-like aliases
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.up rebase
git config --global alias.ci commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment