为什么我在 GIT 上推送我的代码时出现此错误?也许创建一个分支是个好主意?

Why am I obtaining this error pushing my code on GIT? Maybe is it a good idea create a branch?

我正在尝试使用 GIT(从控制台)将我的项目的新版本推送到我的存储库中,但我收到此错误消息:

$ git push origin master
To https://bitbucket.org/MyUserName/glis-toolkit.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://MyUserName@bitbucket.org/MyUserName/glis-toolkit.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.

这是什么意思? "failed to push some refs" 是什么意思?这些是什么 "refs"?

另一个需要考虑的问题是,我的 BitBucket 存储库中的版本是我系统的工作版本(现在与本地版本有很大不同)。我想维护它。也许为这个新版本创建一个类似分支的东西更好?

如果可以的话,我如何创建一个分支并在这个分支上推送这个新版本?

请使用

git pull origin <your branch> 

推送代码之前。 这可能会发生,因为其他人也在分支上推送了一些代码,因此 git 要求先提取这些更改,然后再放置您的更改。