撤消git推送到Assembla [英] Undo git push to Assembla
问题描述
Assembla
存储库。
由于我没有使用git moving命令,所有文件都失去了历史记录。我意识到自己的错误,并希望摆脱不必要的改变,以便在事后做出正确的举动。
我尝试了这种方法,在这里展示,但是我得到了:
$ git push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master
共0(delta 0),重用0(delta 0)
remote:错误:拒绝非-fast-forward refs / heads / master(你应该先拉)
到git@git.assembla.com:myproject.git
! [remote rejected] 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78 - > master(非快速转发)
错误:未能将某些文件推送到'git@git.assembla.com:myproject.git'
信息:
%49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78是标记为'beforerearrange'
关于如何解决这个问题的建议?
当被问及时,我不知道它可能与限制 Assembla
有关。
由于这是一次性交易,我选择了以下工作方法:
在 link (现在已经过时了,但你仍然可以在 way back machine )@ michael-mior提及
现在有一个选项Allow force push Git-Settings页面,所以
- 转至 Assembla.com 转至您的项目 - > Source / Git - > Settings
- 选中复选框允许 - 强制推送
-
强制推送右节点:$ b
$ bgit push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master
$ p
- 清除本地垃圾。
- 返回 Assembla.com 并停用允许 - 强制推送
结果:
< img src =https://i.stack.imgur.com/Z4cQ5.pngalt =在这里输入图片描述>
So - today I wanted to do a good thing and rearrange files in my repository. Committed and pushed up to my Assembla
repository.
Since I did not use the git moving command, all files lost their history. I realized my mistake and wanted to get rid of the unneeded changing so I could make the right kind of move afterwards. I tried the approach, showed in here, but instead I got:
$ git push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To git@git.assembla.com:myproject.git
! [remote rejected] 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78 -> master (non-fast-forward)
error: failed to push some refs to 'git@git.assembla.com:myproject.git'
Info:
% 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78 is the one tagged 'beforerearrange'
Any suggestions on how to fix this problem?
When asked, I had no idea it could be connected with restrictions of Assembla
.
Since this is a one time deal, I choose the following method that worked:
Citing the last comment from Assembla in the link (now obsolete but you can still find it in way back machine) mentioned by @michael-mior There is now an option "Allow force push" in the Git-Settings page, so
- Go to Assembla.com
- Go to your project -> Source/Git -> Settings
- Check the check-box "Allow --force push"
Force push the right node:
git push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master
- Clean up local mess.
- Go back to Assembla.com and disable "Allow --force push"
Result:
这篇关于撤消git推送到Assembla的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!