Dün master'dan yapılmış bir git dalım (v4 adında) var. V4.0'a girmek istediğim, ustalaşmam gereken birkaç değişiklik vardı. Yani, v4'te, ana bilgisayardan bir geri ödeme yapmayı denedim ve bir dosya işleri alt üst etmeye devam ediyor: sürüm numarasını içeren tek satırlık bir metin dosyası. Bu dosya app/views/common/version.txt, yeniden oluşturmadan önce şu metni içerir:
v1.4-alpha-02
İşte yaptığım şey:
> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
version.txtŞimdi şöyle görünür:
<<<<<<< HEAD:app/views/common/version.txt
v1.4-alpha-02
=======
v1.4-alpha-01
>>>>>>> new version, new branch:app/views/common/version.txt
Ben de düzelttim ve şimdi şöyle görünüyor:
v1.4-alpha-02
ve sonra devam etmeye çalıştım: ilk başta bir taahhüdü denedim:
> git commit -a -m "merged"
# Not currently on any branch.
nothing to commit (working directory clean)
Orada şans yok. Yani, dosyayı eklemeye çalışıyordum:
git add app/views/common/version.txt
Cevap yok. Hiçbir haber iyi haber değildir, sanırım. Bu yüzden devam etmeye çalışıyorum:
> git rebase --continue
Applying: new version, new branch
No changes - did you forget to use 'git add'?
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
İşte tam bu noktada, bununla dönüp durduktan sonra, kafamı masadan vuruyorum.
Burada neler oluyor? Neyi yanlış yapıyorum? Biri beni düzeltebilir mi?
EDIT - unutbu için
Dosyayı önerdiğiniz gibi değiştirdim ve aynı hatayı alıyorum:
> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
git rebase master ve başarısız olmasına izin verin ; 2) daha sonra düzenleyip version.txto noktaya bakması gerektiği gibi yaparsınız ve düzenlemeyi kaydedersiniz; 3) o zaman siz git add .../version.txt; 4) o zaman do git rebase --continue( değil 'taahhüt' )! rebase --continueBurada başarılı olursa , zaten taahhüt edilmiştir ( git commitburada gerek yok!) - yani tek yapmanız gereken git push(uzak bir depo kullanıyorsanız). Umarım bu yardımcı olur, eğer doğru yaparsam :)- şerefe!