如何在push命令期间提供in-git凭据?
我正在使用windows powershell创建一个自动脚本,该脚本将克隆回购协议,对其执行一些操作,然后最终推送它 以下是我目前的代码:如何在push命令期间提供in-git凭据?,git,Git,我正在使用windows powershell创建一个自动脚本,该脚本将克隆回购协议,对其执行一些操作,然后最终推送它 以下是我目前的代码: git clone <github-domain>.com/org/repo cd org/ echo "new content" >> newfile.txt git add . git commit -m "added new content" git push origin master # here I recei
git clone <github-domain>.com/org/repo
cd org/
echo "new content" >> newfile.txt
git add .
git commit -m "added new content"
git push origin master # here I receive a pop up asking me for my username and password
git clone.com/org/repo
光盘组织/
echo“新内容”>>newfile.txt
git添加。
git提交-m“添加了新内容”
git push origin master#在这里我收到一个弹出窗口,询问我的用户名和密码
我想知道是否可以在push
命令期间传递用户名和密码,因为这应该是完全自动的
比如:
git推送源主机--用户名a--密码b
我试着在网上查找,但所有来源都指向ssh,没有“自动”的方法
只有第一次,你需要传递密码
请遵循以下步骤:
git config credential.helper store
git push origin master
# supply username and Password for the 1st time
现在,下次他们不需要用户名或密码
谢谢 设置git配置,并且可以配置用户名:
git config user.name“name”
我没有访问此帐户的权限。我只能在它上面运行脚本,但不能远程进入它来执行此操作通常理想的方法是配置ssh密钥
,要运行脚本,您应该具有ssh访问权限。没有这些,你怎么能运行脚本呢。