SORU
22 EYLÜL 2009, Salı


Nasıl geri "git --değiştirme" taahhüt; yerine yapılan "git commit"

Ben yanlışlıkla benim önceki taahhüt değiştirilmiştir. Belirli bir dosya için yapılan değişiklikleri tarih tutmak için ayrı olmalıydı işlemek.

Bir şekilde son işlediğiniz geri almak için var mı? git reset --hard HEAD^, ilk kez böyle bir şey yaparsam taahhüt de bitti.

(henüz uzak dizinler) itti

CEVAP
22 EYLÜL 2009, Salı


Yapmanız gerekenler HEAD önceki sürümü olarak veli ile HEAD taahhüt geçerli olarak, ama aynı detaylara sahip bir tamamlama yeni oluşturmaktır. git reset --soft farklı üzerinde olur commit şimdiki Şube Başkanı şu an olduğu yerden tamamlama, böylece şube işaretçiyi hareket edecek.

# Move the current head so that it's pointing at the old commit
# Leave the index intact for redoing the commit
git reset --soft HEAD@{1}

# commit the current tree using the commit details of the previous
# HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the
# previous command. It's now pointing at the erroneously amended commit.)
git commit -C HEAD@{1}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • pjtoohot

    pjtoohot

    15 NİSAN 2008
  • bored before i even began

    bored before

    30 Mart 2009
  • Trevor Eckhart

    Trevor Eckha

    19 Aralık 2009