Concept

Generally on new systems , We all need to configure our own Git The work environment . Configuration works only once , The current configuration will be used in future upgrades . Of course , if necessary , You can always modify the existing configuration with the same command .

Git There's a name git config Tools for ( Translation notes : the truth is that git-config command , It's just that you can get through git Add a name to call this command .), Specifically used to configure or read the corresponding working environment variables . And it's from these environment variables , To determine the Git The specific working methods and behaviors in each link . These variables can be stored in three different places :

  • /etc/gitconfig file : Configuration that is generally applicable to all users in the system . If you use git config Time use --system Options , That's what I read and write .
  • ~/.gitconfig file : The profile in the user directory only applies to this user . If you use git config Time use --global Options , That's what I read and write .
  • Current project git The configuration file in the directory ( In the working directory .git/config file ): The configuration here is only valid for the current project . Each level of configuration will override the same configuration at the upper level , therefore .git/config The configuration in will be overwritten /etc/gitconfig Variable with the same name in .

Common configuration

User information

 git config --global user.name "happyframework"
git config --global user.email "shijiucha@qq.com"

get help

 $ git help <verb>
$ git <verb> --help
$ man git-<verb>

Git: More articles on configuration

  1. PhpStorm Git To configure ( Solve the problem that the file does not change color )

    Abstract : PhpStorm Git To configure Installation is required first windows Under the Git edition , There are a lot of them on the Internet. What I download is msysgit It's almost the same anyway , Will not own Baidu .  Second, turn on PhpStorm, Click on File ,Setti ...

  2. Android Development of Git To configure

    Android Development of Git To configure 1. First git To configure : Enter the command : git config --global user.name "xxx.xx" git config --globa ...

  3. git First experience ( 6、 ... and )git To configure

    One . Basic configuration Look at this Git Basic configuration actually solves many problems . Two . Client configuration 1.git bash Paste and edit stay git bash Right click on the client header , Now properties , And then put " Check the Quick Edit mode &quo ...

  4. Git Configuration and some common commands

    Git: Common commands .... git clone <repo> git config –list git diff –staged add after ,commit The revocation before :git rm –cached ...

  5. git Configure aliases

    Configure aliases   Do you often type wrong orders ? such as git status?status This word is really hard to remember . If you knock git st It means git status That would be much simpler , Of course, we strongly approve of this kind of laziness . We just need ...

  6. Sina sae Project git To configure

    Sina sae The project now supports git Configured with , But a lot of people don't get it . The following is a summary of this issue . 1. Create a new project on Sina cloud ( This step is omitted ) 2. Generally, after the new building is completed , Will let you choose code management tools , as follows Note that there , ...

  7. Git To configure editor Editor

    Git To configure editor Editor stay ubuntu Under the system ,Git The default editor is the command line , To learn, V What? , It's inconvenient to use When editing submission logs , It's used a lot . You can choose unbuntu The default document editor is git ...

  8. First use git The configuration and git How to use ssh secret key ( take ssh Key added to github)

    Initial installation git Configure the username and mailbox Initial installation git Need to configure user name and mailbox , otherwise git Will prompt :please tell me who you are. You need to run commands to configure your user name and mailbox : $ git con ...

  9. Jenkins+Git To configure

    Jenkins+Git To configure One .GitHub On the configuration Premise :Jenkins Can open normally Upload local files to GitHub On : Access terminal cd Documents cd project git clone htt ...

  10. CentOS 7 Study ( Four )Git To configure ( One )

    CentOS 7 Study ( Four )Git To configure ( One ) 1. For version management system , What is commonly used at present is Subverion and Git,Subversion It's the best in a centralized version management system , Everyone's code has to be submitted to the server , If you want to know ...

Random recommendation

  1. Some suggestions for titanium products (Note)

    background : The last mouse was broken , today 299 From Jingdong like a titanium mouse , The core materials are said to be very high-end , The design is also good . But in practice, we found a lot of common sense problems and product suggestions , Then feedback to titanium customer service , And record it here . Portal : http://bbs ...

  2. c# How to implement a thread pause , Wait for the user to enter text and continue ?

    using System; using System.Text; using System.Windows.Forms; using System.Threading; namespace Windo ...

  3. About history Of Linux Command line

    1. Use HISTTIMEFORMAT Show timestamps when you execute from the command line history After the command , Usually only the sequence number of the executed command and the command itself are displayed . If you want to see the timestamp of the command history , Then you can execute : # export H ...

  4. [ turn ]C# Compress packed files

    /// <summary> /// Compress and decompress files /// </summary> public class ZipClass { /// <summary> /// ...

  5. poj2777 Line segment tree

    //Accepted 4768 KB 391 ms // Line segment tree , The application of delay marking // For each paragraph , Use one int Represents the case of being colored ,change Mark whether the color of the segment changes as a whole , That's the paragraph // Use it or not. Paint it all ...

  6. CUDA And VS2013 install

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  7. Ten filtering algorithm program complete (Arduino Accurate Edition )( turn )

    Source : Ten filtering algorithm program complete (Arduino Accurate Edition ) Reprint please indicate the source : Geek workshop   http://www.geek-workshop.com/thread-7694-1-1.html

  8. 80 Post programmer pay cut 6K, A hunch of a midlife crisis , Prepare for job hopping but hit the wall

    When it comes to programmers , A lot of people think about it “ High wages ”“ Good technology ” And so on , It can be seen that programmer is a very lucrative profession , So every year there are many graduates to choose this industry . But society is fair , Don't just look at the brilliance of programmers , There are also many behind it ...

  9. 20181219-PostgreSQL Stream replication monitoring script

    PostgreSQL Stream replication monitoring script https://github.com/AndyYHM/Writing/blob/PostgreSQL/20181219-PostgreSQL%20Stream%2 ...

  10. angular $digest already in progress

    angular.js:11706 Error: [$rootScope:inprog] $digest already in progresshttp://errors.angularjs.org/1 ...