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

'git push' always needs password and username

时间:2018-07-01 10:34:41      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:command   github   clone   lob   ssh   after   out   osi   man   

Refer to :

https://help.github.com/articles/caching-your-github-password-in-git/

https://help.github.com/articles/why-is-git-always-asking-for-my-password/

 

If Git prompts you for a username and password every time you try to interact with GitHub, you‘re probably using the HTTPS clone URL for your repository.

Using an HTTPS remote URL has some advantages: it‘s easier to set up than SSH, and usually works through strict firewalls and proxies. However, it also prompts you to enter your GitHub credentials every time you pull or push a repository.

 

Caching your GitHub password in Git

Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.

  1. In Terminal, enter the following:

    git config --global credential.helper cache
    # Set git to use the credential memory cache
    
  2. To change the default password cache timeout, enter the following:

    git config --global credential.helper ‘cache --timeout=3600‘
    # Set the cache to timeout after 1 hour (setting is in seconds)
    

'git push' always needs password and username

标签:command   github   clone   lob   ssh   after   out   osi   man   

原文地址:https://www.cnblogs.com/quinn-yann/p/9249250.html

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