我的朋友的项目在Git存储库中,我下载了“Git-1.9.4-preview20140929.exe”,并安装了GIT bash将该项目拉到我的电脑上,并成功完成操作。
$ git clone <with SSH clone URL>
我在本地系统中获取了该项目,并进行了一些更改,现在我想把这些更改推送回存储库,因此我进行了以下操作:
$ git init
Reinitialized existing Git repository in c:/users....
并且
$ git add .
$ pom.xml
./pom.xml: line 1: project: No such file or directory
./pom.xml: line 2: syntax error near unexpected token `newline'
./pom.xml: line 2: ` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http
://maven.apache.org/maven-v4_0_0.xsd">'
并且。
$ git commit -m 'First commit'
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
and
$ git push -u origin master:master
Enter passphrase for key '/h/.ssh/id_rsa':
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
或者
$ git push origin master
Enter passphrase for key '/h/.ssh/id_rsa':
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
大多数人在之前的Stack Overflow问题/答案中都有同样的问题,但原因不同,并且已尝试使用这些答案,但无法解决错误,请指导我,谢谢!
git-cmd.bat
,如https://dev59.com/pHbZa4cB1Zd3GeqPHZIl#18679161或http://stackoverflow.com/a/15217630/6309:然后您可以检查HOME是否正确设置。 然后,您可以检查%HOME%/.ssh是否存在。 然后您可以再次联系我。git-cmd.bat
已打包在您的msysgit发行版中。 - VonCc:\prgs\git\PortableGit-1.9.0-preview20140217\git-cmd.bat
。其内容看起来像是这样 https://github.com/msysgit/msysgit/blob/master/git-cmd.bat。"Git for Windows" 来自于这里 https://github.com/msysgit/msysgit/releases/tag/Git-1.9.4-preview20140929。 - VonCc:\prgs\git\PortableGit-1.9.0-preview20140217\git-cmd.bat
。它的内容看起来像https://github.com/msysgit/msysgit/blob/master/git-cmd.bat。“Git for Windows”来自https://github.com/msysgit/msysgit/releases/tag/Git-1.9.4-preview20140929。 - VonCgit-cmd.bat
。使用该文件打开一个cmd
会话,其中HOME
将被定义,并且 git 已经被添加到PATH
中。 - VonC