[git] https模式下,自动输入用户名和密码
2014-01-19 17:43
323 查看
如何让git 提交时,不输入用户名和密码?
按照git 的加key的说明:
https://help.github.com/articles/generating-ssh-keys
当仍然会要求输入用户名和密码,最后找到了临时解决方法:
https://help.github.com/articles/set-up-git
First you need to tell git your name, so that it can properly label the commits you make.
Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.
Your email address for Git should be the same one associated with your GitHub account. If it is not, see this
guide for help adding additional emails to your GitHub account. If you want to keep your email address hidden, this
guide may be useful to you.
Overriding
The last option we need to set will tell git that you don't want to type your username and password every time you talk to a remote server.
Tip: You need git 1.7.10 or
newer to use the credential helper
To use this option, you need to 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. You can change this if you like.
Tip: The credential helper only works when you clone an HTTPS repository
URL. If you use the SSH repository URL instead, SSH keys are used for authentication. This
guide offers help generating and using an SSH key pair.
按照git 的加key的说明:
https://help.github.com/articles/generating-ssh-keys
ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/home/you/.ssh/id_rsa): ssh-add id_rsa
sudo apt-get install xclip # Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`) xclip -sel clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
当仍然会要求输入用户名和密码,最后找到了临时解决方法:
https://help.github.com/articles/set-up-git
Username
First you need to tell git your name, so that it can properly label the commits you make.git config --global user.name "Your Name Here" # Sets the default name for git to use when you commit
Email
Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.git config --global user.email "your_email@example.com" # Sets the default email for git to use when you commit
Your email address for Git should be the same one associated with your GitHub account. If it is not, see this
guide for help adding additional emails to your GitHub account. If you want to keep your email address hidden, this
guide may be useful to you.
Overriding
settings in individual repos
Password
caching
The last option we need to set will tell git that you don't want to type your username and password every time you talk to a remote server.Tip: You need git 1.7.10 or
newer to use the credential helper
To use this option, you need to turn on the credential helper so that git will save your password in memory for some time:
git config --global credential.helper cache # Set git to use the credential memory cache
By default git will cache your password for 15 minutes. You can change this if you like.
git config --global credential.helper 'cache --timeout=3600' # Set the cache to timeout after 1 hour (setting is in seconds)
Tip: The credential helper only works when you clone an HTTPS repository
URL. If you use the SSH repository URL instead, SSH keys are used for authentication. This
guide offers help generating and using an SSH key pair.
相关文章推荐
- 用https访问GIT服务时避免输入用户名、密码的方法
- 解决git以 https和ssh方式 每次都要输入用户名和密码问题
- Git HTTPS 方式自动保存用户名密码
- 每次git push到远程库都要输入用户名和密码?
- 怎样使 WinXP 启动时不用输入用户名和密码即自动进入系统到桌面?
- 设置Git不需要每次push都输入用户名和密码
- Genesis自动登录方法(免输入用户名和密码)
- 解决git 每次都要输入用户名和密码问题
- window设置TortoiseGit连接git不用每次输入用户名和密码
- git push的时候每次都要输入用户名和密码的问题解决
- git pull/push项目的时候总是提示要输入用户名密码的解决方案
- 使用SSH方式免去Git每次push都输入用户名和密码
- 在mac中自动保存git用户名与密码如此简单
- idea中git提交代码遇到的问题(反复输入密码,用户名显示不正常)
- GitPush避免重复输入用户名和密码
- Github:每次git push推送的时候都需要输入git的用户名和密码
- Git@OSC push 不用每次输入用户名和密码的方法
- 第三步 使用scp远程拷贝,自动输入用户名和密码
- Git中连接github不用每次输入用户名和密码的方法
- GIT避免多次重复输入用户名密码