码迷,mamicode.com
首页 > 其他好文 > 详细

git config user.name

时间:2019-11-06 22:57:37      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:Nging   shell   set   its   private   compute   conf   figure   line   

Setting your username in Git

Git uses a username to associate commits with an identity. The Git username is not the same as your GitHub username.

You can change the name that is associated with your Git commits using the git config command. The new name you set will be visible in any future commits you push to GitHub from the command line. If you‘d like to keep your real name private, you can use any text as your Git username.

Changing the name associated with your Git commits using git config will only affect future commits and will not change the name used for past commits.

Setting your Git username for every repository on your computer

  1. Open Git Bash.

  2. Set a Git username:

    $ git config --global user.name "Mona Lisa"
  3. Confirm that you have set the Git username correctly:

    $ git config --global user.name
    > Mona Lisa

Setting your Git username for a single repository

  1. Open Git Bash.

  2. Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.

  3. Set a Git username:

    $ git config user.name "Mona Lisa"
  4. Confirm that you have set the Git username correctly:

    $ git config user.name
    > Mona Lisa

git config user.name

标签:Nging   shell   set   its   private   compute   conf   figure   line   

原文地址:https://www.cnblogs.com/oxspirt/p/11809091.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!