• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wjl327
V2EX  ›  程序员

问一个 Git 的问题。

  •  
  •   wjl327 · Dec 5, 2014 · 3296 views
    This topic created in 4189 days ago, the information mentioned may be changed or developed.
    同一台机器,有Github,又有公司的git服务器,例如Gitlab。这个时候,两个如何分别设置 git config --global user.name 。 global 是全局的呀。。
    3 replies    2014-12-05 18:17:49 +08:00
    xieguanglei
        1
    xieguanglei  
       Dec 5, 2014
    git config user.name 只对当前仓库有效
    git config --global user.name 全局有效
    linzy
        2
    linzy  
       Dec 5, 2014
    一般是直接clone出两个项目出来
    s51431980
        3
    s51431980  
       Dec 5, 2014   ❤️ 1
    --global 用词不准确,因为只对当前user有效,配置文件在 ~/.gitconfig
    --system 才是真正的“全局”,对所有用户有效,配置文件 在 /etc/gitconfig
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5195 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    ♥ Do have faith in what you're doing.