撤消git推送到Assembla [英] Undo git push to Assembla

查看:191
本文介绍了撤消git推送到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页面,所以



  1. 转至 Assembla.com
  2. 转至您的项目 - > Source / Git - > Settings
  3. 选中复选框允许 - 强制推送

  4. 强制推送右节点:$ b​​
    $ b

      git push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master 
  5. 清除本地垃圾。

  6. 返回 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

  1. Go to Assembla.com
  2. Go to your project -> Source/Git -> Settings
  3. Check the check-box "Allow --force push"
  4. Force push the right node:

    git push -f origin 49bcfdceb30a1e9cfab0f0e7e39bfa04dc726b78:master
    

  5. Clean up local mess.
  6. Go back to Assembla.com and disable "Allow --force push"

Result:

这篇关于撤消git推送到Assembla的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆