Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 2.37 KB

README.md

File metadata and controls

54 lines (35 loc) · 2.37 KB

Git Starter

This Git repository contains basic and recommended Git configurations in addition to useful web URLs.

Git configuration

Basic settings

At least every user should configure her/his name and a commit email address. These settings can be configured globally with the --global parameter and will be saved in the user's root directory (~/.gitconfig):

git config --global user.name "firstname lastname"
git config --global user.email [email protected]

Recommended settings

The recommendation for an additional configuration includes:

  • Global gitignore file (gitignore)
  • Commit message template (gitmessage)
  • Default branch changed to main (from 'master') (requires Git 2.28+)
  • Simple push (only push current branch)
  • Recursive submodule init

The basic and recommended settings are provided in the file gitconfig-recommendations. Please change the user settings if the content is copied.

Optional settings

Some additional settings are included in the gitconfig-complete configuration template (like aliases and color settings).

Usage of provided configurations

The global configurations are a user-specific settings found in the user home directory (~/) (or in the User folder for Windows, e.g. C:\Users\<YourName>)

  1. Copy either gitconfig-recommendations or gitconfig-complete to ~/.gitconfig (or ~/.config/git/config)
  2. Replace username and commit email address in ~/.gitconfig (or ~/.config/git/config) directly or via git config commands
  3. Copy gitignore to ~/.gitignore
  4. Copy gitmessage to ~/.gitmessage

Useful resources

Git basics:

Best practices: