Magical Git profile

We must first of its profits. To know how to control the operation of the program in order to maximize Git maximize function.

Git has three different levels of profiles, respectively provided with different priorities, high priority documents will cover the same low priority settings file.

1. Folder '.git' config files in subfolders.

This configuration file has the highest priority, but the profile of its only effective where the document library.

.gitconfig file home directory 2. login account of.

This user profile is only valid for this account logs.

etc / gitconfig installation files 3.Git program folder.

This is a common configuration files are valid for all login accounts and all documents Git repository.

 

Usage 2-1 "git config" command

Git display the current setting value can perform the following instructions:

git config -l

The display settings Git installation folder etc \ gitconfig file

git config --system -l

Set in the home directory login account in .gitconfig file

git config --global-l

If you want to modify the configuration file in a document library, for example, modify the user's name and mailbox

git config user.name 'operator name'

git config user.email 'operator email'

If you want to delete configuration settings, you can enter

git config --unset user.name

2-2 to modify the default text editor and file comparison program

git config --global core.editor notepad

Example is the default editor into Windows Notepad program

git diff

The instructions for performing file comparison feature, you can compare between the latest version of the current file in the folder and document library differences.

Guess you like

Origin www.cnblogs.com/psztswcbyy/p/11318385.html