覆蓋Git已經push的commit

 

1. 先觀察整體節點圖

  • git log --graph --oneline --all
  •  
  • 2. 回復至指定commit位置

  • git reset "指定SHA1" --hard

 

  • 3. Push commit並強制覆蓋

  • git push -f origin master

 

  • 4. Push commit並強制覆蓋 (確認是否有他人同時提交)

  • git push --force-with-lease origin master

 

創作者介紹
創作者 Rex-Software-Blog 的頭像
Rex

Rex-Software-Blog

Rex 發表在 痞客邦 留言(0) 人氣( 162 )