2010-11-24 38 views
0

我弄亂了我的遠程存儲庫,我可以恢復它嗎?我搞砸了一個遠程存儲庫,我可以從本地還原嗎?

現狀:

  • 筆記本電腦(拉形式儲存庫, 我從另一臺筆記本電腦推與 錯誤的數據)
  • 桌面(其中有一個良好的 本地倉庫 - 昨天)

臺式機

[email protected]:/var/www/html/t1.org$ git remote show origin 
Enter passphrase for key '/home/gd/.ssh/id_rsa': 
* remote origin 
    Fetch URL: [email protected]:t1_org.git 
    Push URL: [email protected]: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) 

在桌面上,開發已過時,遠程設備上的應有信息是不同的,但是不對。

我可以將本地存儲庫從我的桌面推送到我的git服務器嗎?然後重新應用修補程序並將所有內容都拉回筆記本電腦上?

如果需要提供更多信息,請告訴我。

TIA, Fossie

+1

這是有點不清楚你的意思是「搞砸了」。如果你的意思是「消滅」,那麼通過一切手段,推回到那裏。如果你的意思是「推送一個錯誤的提交」,那麼你可能只是想恢復提交。我想你是在這兩個極端之間的某個地方? – Cascabel 2010-11-24 15:37:27

回答

0

您可以強制覆寫與git push -f從本地(好)庫。

+0

如果您與其他人共享此回購,這可能會導致嚴重的問題,如果他們已經從你的不良推動拉。當別人推動中央回購時,改變中央回購的歷史並不是一個好習慣。 – brycemcd 2010-11-24 15:35:17

相關問題