git push origin master致命错误

时间:2017-04-25 16:57:01

标签: git

我试图在我的Mac OS上从终端推送我的工作时遇到错误,并希望有人可以提供帮助!从我的GitHub帐户克隆时,我尝试了ssh协议和https:协议,但同样的致命消息出现了。

非常感谢任何和所有帮助!

Jacobs-MacBook-Pro:bloc-jams JYUN$ ls
index.html
Jacobs-MacBook-Pro:bloc-jams JYUN$ git clone       
https://github.com/sekkinsan/bloc-jams.git
Cloning into 'bloc-jams'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Jacobs-MacBook-Pro:bloc-jams JYUN$ 
Jacobs-MacBook-Pro:bloc-jams JYUN$ git add .
Jacobs-MacBook-Pro:bloc-jams JYUN$ git commit -m "commit html and css"
[master (root-commit) 929806f] commit html and css
 2 files changed, 27 insertions(+)
 create mode 160000 Desktop/bloc/bloc-jams/bloc-jams
create mode 100644 Desktop/bloc/bloc-jams/index.html
**Jacobs-MacBook-Pro:bloc-jams JYUN$ git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.**

提前致谢!

2 个答案:

答案 0 :(得分:0)

感谢您的帮助!我不太能够弄清楚问题是什么,但是等了一天再试一次它才有效......

在下面发布终端任务以供参考。 再次感谢您的帮助。

Jacobs-MacBook-Pro:bloc-jams JYUN$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

new file:   index.html

Jacobs-MacBook-Pro:bloc-jams JYUN$ git commit -m "first commit"
[master 499626c] first commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 index.html
Jacobs-MacBook-Pro:bloc-jams JYUN$ git remote add origin     https://github.com/sekkinsan/bloc-jams.git
fatal: remote origin already exists.
Jacobs-MacBook-Pro:bloc-jams JYUN$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 279 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/sekkinsan/bloc-jams.git
   0cf6475..499626c  master -> master

答案 1 :(得分:0)

在您的情况下,您当前的目录是没有远程的本地仓库的工作区。

集团/集团-卡纸/

当您运行git clone时,它将在子目录中生成一个新工作区。

集团/集团-卡纸/集团-卡纸/

除非您更改到该目录,否则您将看不到该目录的遥控器。