开发者

can't commit to git / github

So I just opened an account on github, and trying to submit (checkin / commit/ whatever...) a project to a new repo.

I followed the following steps:

  • create a repo on the web
  • followed those steps from the web:

Next steps:

mkdir PROJECT
cd PROJECT
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:username/PROJECT.git
git push -u origin master

When I run git remote开发者_Go百科 add origin git@github.com:username/PROJECT.git I get the following error:

fatal: Not a git repository (or any of the parent directories): .git

Any ideas? In any case, I can't clone this project - it's empty on the repo.

Thanks!


That error indicates that when you ran the 'git remote add' command you're not in a directory which is a git repository. I would only expect that to happen if you're not in the directory where you did the 'git init'. Did all of previous git commands succeed? Did you remove the .git directory before you did the 'git remote add' or cd out of the PROJECT directory? Did you just run the 'git remote add' in another directory?

Can you cut and paste a transcript of what you've done so we can help determine what went awry?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜