Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.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推送被拒绝了_Git_Bitbucket - Fatal编程技术网

Git状态报告分支机构使用';原点/主点';,但是git推送被拒绝了

Git状态报告分支机构使用';原点/主点';,但是git推送被拒绝了,git,bitbucket,Git,Bitbucket,当我输入git status时,我得到以下信息: On branch master Your branch is up-to-date with 'origin/master' 但当我输入git push时,我得到了以下结果: ! [rejected] master -> master (fetch first) error: failed to push some refs to 'git@bitbucket.org:FoxRocks/pams_amo.git' hin

当我输入
git status
时,我得到以下信息:

On branch master 
Your branch is up-to-date with 'origin/master'
但当我输入git push时,我得到了以下结果:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@bitbucket.org:FoxRocks/pams_amo.git'
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提取
,因为我不知道有什么区别。我读了另一篇帖子,上面说我应该输入
git fetch origin
,然后输入
git diff master origin/master
,但这两个命令都不会返回任何结果。我添加了
-v
,以为我会得到更多信息,但没有

我是否误解了“最新的‘原始/主版本’”的含义

我是否误解了“最新的‘原始/主版本’”的含义

可能是的
origin/master
在远程
origin
上跟踪
master
,但它仍然只是本地的,不会自动与远程保持最新。因此,您可以在远程
origin
上更新
origin/master
,但不能更新
master
。当你试着推的时候,差异就会显现出来


要同步它们,
git fetch
。现在,
git status
可能会改变它的音调!试试看。

origin/master
远程存储库中的
master
提示可能指向不同的提交。当远程存储库中的
master
被其他人更新时,
origin/master
在您运行
git-fetch
git-pull
之前,本地存储库中的
origin/master
不会得到更新。我确信我已经输入了
git-fetch
,但当我刚才尝试时,它实际上做了一些事情,现在当我输入
git-status
时,它给了我一个清晰的画面。谢谢耶!我希望你对什么是起源/大师有一个更清晰的概念。它确实是这样的!我不确定的一件事是,一旦我输入了
git fetch
,现在如何查看在我最新的本地提交中添加了哪些更改?我有5到6个本地更改的文件,它们是我们添加和提交的,但不是推送的,但在我获取后,我无法看到它们的
git状态
。您将区分master和origin/master