我朋友在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
和
$ 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问题/答案),但原因不同,并尝试过这些答案,但无法修复错误,请给我指示,谢谢!
答案 0 :(得分:11)
在the chat之后,使用github配置链接的正确方法是:
cd c:\Users\ramas\dmsproject\dms
git remote set-url origin git@github.com:vamsiannem/dms.git
然后git push
可以正常工作。
答案 1 :(得分:0)
我也有这个问题,但最后我找到了已编辑但未在我的工作区域提交的文件。所以在我提交之后,就像这样:
然后我使用完成的git push -u origin master
!