Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Git Best Practices Guide

You're reading from   Git Best Practices Guide Master the best practices of Git with the help of real-time scenarios to maximize team efficiency and workflow

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783553730
Length 102 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
PIDOUX Eric PIDOUX Eric
Author Profile Icon PIDOUX Eric
PIDOUX Eric
Arrow right icon
View More author details
Toc

Customizing Git


As you already know, when you install Git, you have to configure your username and e-mail, but this isn't the only one configuration you can do:

Erik@server~:$ git config --global user.name 'Erik'
Erik@server~:$ git config --global user.email '[email protected]'

Git uses a series of configuration files to perform various activities. First, Git checks the /etc/gitconfig file that contains configurations for every user.

Then, Git looks in ~/.gitconfig, which is specific to each user. Finally, Git checks the .git/config file inside the repository.

There are a lot of options available, but we will cover only the commonly used. You can see a list of all options executing this:

Erik@server~:$ git config -help

You will find a lot of options to play with, but here are the most important ones:

  • Editor: You can use editors such as Emacs, Vi, nano, and so on. The following example shows how to use your favorite editor:

    Erik@server~:$ git config --global core.editor nano
    
  • Commit template...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images