Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
致命的';原产地';似乎不是git存储库_Git_Github - Fatal编程技术网

致命的';原产地';似乎不是git存储库

致命的';原产地';似乎不是git存储库,git,github,Git,Github,我创建了一个远程回购,然后在本地创建了一个本地回购: git init 然后使用git add然后git commit-m“something” 最后,git推送原始主机 我犯了一个致命的错误: '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

我创建了一个远程回购,然后在本地创建了一个本地回购:

git init
然后使用
git add
然后
git commit-m“something”

最后,
git推送原始主机

我犯了一个致命的错误:

'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.
我应该在一些命令中使用远程和本地命令吗?如果是这样的话,如果我已经添加并提交了,或者我应该在本地重新开始吗

编辑:

显然,我应该添加
git远程添加源代码ssh://git@example.com:1234/myRepo.git
但是我应该用什么替换ssh呢?在哪里可以找到我应该添加的内容的版本呢

出现以下错误:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

运行
git clone
克隆存储库时,会自动创建默认的远程
origin
。如果存储库是由
gitinit
创建的,则没有默认的远程存储库,也没有
源存储库。你需要自己设置

git remote add origin <repo_url>
git远程添加源
repo_url
是指向要与之交换数据的现有远程存储库的路径。如果它在本地磁盘中,则可能是
file:///home/me/foo.git
/home/me/foo.git
。如果它托管在Github中,那么它可能是
https://github.com/me/foo.git
ssh://git@github.com/me/foo.git


关于“先取”的第二个错误。在下一次推送之前,您需要运行
git pull origin
git pull-r origin

这是因为您的配置文件包含master word而不是heroku git url。当您多次初始化git时,可能会发生这种情况

  • 编辑配置文件

    git配置--e

  • 然后将主单词编辑为heroku url,例如

  • 保存它wq

  • 然后通过git push heroku master推送更新


  • 我希望这对你有帮助

    我在尝试进行PR时收到了相同的错误消息。仔细看,我意识到我是在一个错误的目录上执行Git工作流的

    git remote add origin <url>
    
    在我的例子中,我只是使用**cd..**返回到右边的目录,然后继续操作,不再出错。

    试试这个

    git remote add origin <https://github.com/"username"/"repository".git> 
    
    在命令下方运行

    git remote add origin git@github.com:xxxx/xxxx.git
    

    请不要嘘

    首先需要运行此命令:

    git remote add origin https://github.com/"USERNAME"/"REPOSITORY_NAME".git
    
    在此之后:

    git push -u origin "branch name"
    

    这会有用的

    可能重复的可能重复的请在解释代码的地方添加文本,并说明这两个命令的作用!在这样做时,数据将以哪种方式传输?我在本地拥有我的数据,不想过度写入数据,而是以错误的方式传输数据!
    git remote add origin https://github.com/"USERNAME"/"REPOSITORY_NAME".git
    
    git push -u origin "branch name"