git克隆工作正常,推送无法从php中获得相同的url
我正在运行以下命令:git克隆工作正常,推送无法从php中获得相同的url,git,Git,我正在运行以下命令: $Command = "https://user:password@mydomain.com/MyGit/code.git"; exec("git clone " . $Command); //copy a file into the cloned repository exec("git commit -am \"files added\""); exec("git push &q
$Command = "https://user:password@mydomain.com/MyGit/code.git";
exec("git clone " . $Command);
//copy a file into the cloned repository
exec("git commit -am \"files added\"");
exec("git push " . $Command);
除了导致此错误的最后一行之外,所有操作都正常:
远程:无效的用户名或密码
致命:对https://user:password@mydomain.com/MyGit/code.git
我想知道发生了什么,因为同一个用户密码组合用于克隆,而我是repo的所有者,所以对“用户”授予读/写访问权
我不想设置外部安全密钥,我只想通过HTTPS进行简单的用户密码验证。尝试使用以下方式进行git推送:
exec("git push origin master");
基本上,URL地址保存在项目的
.git/config
文件中作为对原始repo的引用。从https://mydomain.com/MyGit/code.git(不带用户名和密码)进行克隆是否可行?