开发者

I have messed up a remote repository, can I restore from a local that's ok?

I've messed up my remote repository, can I restore it?

Situation:

  • laptop (pulled form repository where I pushed from another laptop with wrong data)
  • desktop (which has a good local reposito开发者_StackOverflow中文版ry - yesterday)

desktop

gd@t4q:/var/www/html/t1.org$ git remote show origin
Enter passphrase for key '/home/gd/.ssh/id_rsa': 
* remote origin
  Fetch URL: git@ip:t1_org.git
  Push  URL: git@ip:t1_org.git
  HEAD branch: master
  Remote branches:
    develop tracked
    master  tracked
  Local branches configured for 'git pull':
    develop merges with remote develop
    master  merges with remote master
  Local refs configured for 'git push':
    develop pushes to develop (local out of date)
    master  pushes to master  (up to date)

On the desktop, develop is out of date, due information on the remote is different, but wrong.

Can I push local repository from my desktop to my git server? Then reapply patches and pull everything back on my laptop?

If I do need to provide more information, please let me know.

TIA, Fossie


You can force an overwrite with git push -f from your local (good) repository.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜