Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash Shell脚本->;对git提示符使用预定义的用户名和密码_Bash_Sh - Fatal编程技术网

Bash Shell脚本->;对git提示符使用预定义的用户名和密码

Bash Shell脚本->;对git提示符使用预定义的用户名和密码,bash,sh,Bash,Sh,我想使用文件中存储的预定义用户名和密码,以及在git repo中提交时如何使用它,git repo要求提供用户名和密码。我建议您这样做: git remote set-url origin https://name:password@github.org/repo.git 或者使用SSH而不是https(最佳) git repo是否支持ssh密钥?他们允许无密码访问。是的。。。但我假设最终用户没有使用ssh密钥进行设置。我假设最终用户手动输入用户名和密码。我只想保存它,这样就不需要在每次提交时

我想使用文件中存储的预定义用户名和密码,以及在git repo中提交时如何使用它,git repo要求提供用户名和密码。

我建议您这样做:

git remote set-url origin https://name:password@github.org/repo.git
或者使用SSH而不是https(最佳)


git repo是否支持ssh密钥?他们允许无密码访问。是的。。。但我假设最终用户没有使用ssh密钥进行设置。我假设最终用户手动输入用户名和密码。我只想保存它,这样就不需要在每次提交时再次输入。我将尝试此。。只想知道当gitpush命令要求输入用户名和密码时,是否有任何方法可以提供这些详细信息(比如我将它们保存在文本文件中,并将它们保存在shell脚本变量中),您必须使用expect
git remote set-url origin git+ssh://git@github.com/username/reponame.git