如何进入有密码的git pull命令? [英] How to enter command with password for git pull?

查看:1241
本文介绍了如何进入有密码的git pull命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个线做这个命令:混帐拉和放;&安培; [我的密码]

I want to do this command in one line: git pull && [my passphrase]

怎么办呢?

推荐答案

这不完全是你问什么,但对于HTTP(S):

This is not exactly what you asked for, but for http(s):


  • 您可以把(在Windows _netrc)在.netrc文件的密码。从那里,它会被自动拾取。它会去你家的文件夹权限600

  • 您也可以只克隆与 HTTPS回购://用户:通过@域名/回购但是这并不推荐使用,因为它会显示您的用户名/密码的很多地方...

  • 一个新的选项是使用凭证帮手 。请注意,凭证将使用标准凭据助手被明文存储在您的本地配置。凭据佣工wincred也可以在Windows上使用。

  • you can put the password in .netrc file (_netrc on windows). From there it would be picked up automatically. It would go to your home folder with 600 permissions.
  • you could also just clone the repo with https://user:pass@domain/repo but that's not really recommended as it would show your user/pass in a lot of places...
  • a new option is to use the credential helper. Note that credentials would be stored in clear text in your local config using standard credential helper. credential-helper with wincred can be also used on windows.

有关凭证帮手用法示例


  • 混帐配置credential.helper店 - 无限期存储凭据

  • 混帐配置credential.helper'缓存--timeout = 3600 - 60分钟专卖店

  • git config credential.helper store - stores the credentials indefinitely.
  • git config credential.helper 'cache --timeout=3600'- stores for 60 minutes

有关基于SSH访问,你会使用SSH代理需要时,将提供SSH密钥。这将要求您的计算机上生成密钥,存储在远程服务器上的公共密钥,并添加私有密钥相关密钥库。

For ssh-based access, you'd use ssh agent that will provide the ssh key when needed. This would require generating keys on your computer, storing the public key on the remote server and adding the private key to relevant keystore.

这篇关于如何进入有密码的git pull命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆