[英]How can I push with sourceTree?
我正在使用 sourceTree 管理 Unity (ver 4.6.3) 的项目我只想返回到之前的提交,右键单击选择“将当前分支重置为此提交”,在使用模式中选择“硬”,然后将其放回到上一次提交。 之后,我试图推动,但我没有推动。 对不起,我当时忘记接受错误了。
在那之后,我认为我无法按原样推送,所以我创建了另一个远程存储库,将我的 Unity 项目移到那里并提交。 虽然我能够承诺,但我无法推动它。 当时的错误就在这里
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.
是否有需要删除的文件? 如果你知道答案,请告诉我。
如果您执行reset --hard
,则需要强制推送才能完成操作。
您首先需要在选项菜单中启用强制推送,然后您将能够在使用“安全”和“不安全”强制推送之间进行选择。
每次从推送对话框使用强制推送时,您都需要选中复选框,并确认对话框提示。
如果您不是一个人在该存储库上工作,请确保您已经警告过您的同事。
(考虑到 SourceTree 尚不支持git push --force-with-lease
)
我的Source Tree
v. 3.1.2
有以下选项:
Tools
→ Options
→ Git
→ Enable Force Push
→ Use Safe Force Push (--force-with-lease)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.