如何使用sourceTree推送? [英] How can I push with sourceTree?
问题描述
我正在使用sourceTree管理Unity(版本4.6.3)的项目 我只想返回上一个提交,右键单击以选择将当前分支重置为此提交",在使用模式下选择硬",然后将其放回上一个提交. 在那之后,我尝试推动,但是我没有推动. 抱歉,我当时没记错.
I am managing project of Unity (ver 4.6.3) with sourceTree I just wanted to return to the previous commit, right click to select "Reset current branch to this commit", select "Hard" in the using mode, and put it back to the previous commit. After that, I tried to push, but I failed to push. Sorry, I forgot to take the error at that time.
此后,我以为无法按原样推送,所以我创建了另一个远程存储库,将我的Unity项目移到那里并提交了它. 尽管我能够提交,但我无法推动它.当时的错误在这里
After that, I thought that I could not push as it was, so I created another remote repository, moved my Unity project there and committed it. Although I was able to commit, I could not push it. The error at that time is here
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags
origin master:master
fatal: HttpRequestException encountered.
????v??????M????G???[??????????????B
Pushing to "my remote repository"
To "my remote remote repository"
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'my remote repository'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
是否有需要删除的文件?如果您知道答案,请告诉我.
Is there a file that needs to be deleted? If you know answer, please let me know.
推荐答案
如果执行reset --hard
,则需要强制执行推送才能完成操作.
If you do a reset --hard
, you will need to force the push in order to complete your operation.
支持
您首先需要在选项菜单中启用强制推送,然后您就可以在使用安全"和不安全"强制推送之间进行选择. You'll first need to enable force-push in the options menu, and from there you will be able to choose between using "safe" and "unsafe" force-push. 如果您不是一个人在该存储库上工作,请确保已警告您的同事. Make sure you have warned your colleague, if you are not alone working on that repository. 这篇关于如何使用sourceTree推送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
每次您在推式对话框中使用强制推式时,都需要选中该复选框,并确认对话框提示.
Each time you use force-push from the push dialog you'll need to check the checkbox, and confirm the dialog prompt.
(考虑SourceTree尚不支持 git push --force-with-lease
)
(considering git push --force-with-lease
is not yet supported by SourceTree)