Sto provando a riordinare 2 commit, e continuo a ricevere un errore senza alcun tipo di spiegazione, quindi non ho idea di cosa sto facendo male.Errore durante il riordino con git rebase -i
Questa è la repo:
$ git lol
* c0000ca (HEAD, master) added a title
* 132247f Turned colors to html
* 0ddaef3 Added last sentences
* 95f8007 initial commit
voglio scambiare 132247f e 0ddaef3.
$ git rebase -i 95f8007
Questo mi tiene nano:
pick 0ddaef3 Added last sentences
pick 132247f Turned colors to html
pick c0000ca added a title
# Rebase 95f8007..c0000ca onto 95f8007
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
sostituisco entrambe le linee, salvare e uscire. Questo è il messaggio di errore ottengo:
error: could not apply 132247f... Turned colors to html
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
Could not apply 132247f... Turned colors to html
Come un messaggio di errore, non è molto utile .... qualcuno sa che cosa sta succedendo?
L'unico file nel repository sembra essere in conflitto:
$ cat poem.md
<<<<<<< HEAD
Roses are red.
Violets are blue.
=======
Roses are #ff0000.
Violets are #0000ff.
All of my bases,
are belong to you.
>>>>>>> 132247f... Turned colors to html
Se io risolvere il conflitto, aggiungere il git di file ed eseguire rebase --continue, ottengo questo altro errore:
$ git rebase --continue
[detached HEAD 9aba127] Turned colors to html
1 file changed, 4 insertions(+), 2 deletions(-)
error: could not apply 0ddaef3... Added last sentences
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
Could not apply 0ddaef3... Added last sentences
Questo mi sta facendo impazzire, ogni aiuto è apprezzato.
Ti sei assicurato di aggiungere nuovamente il file all'indice? Se non lo fai, il 'rebase' considererà il file in conflitto – JaredPar
Devi git aggiungere il file prima di git -rebase -i? – cfischer
No, non dovresti aggiungere il file prima di ridiscutere e 'git rebase --continue' dovrebbe occuparsi di tutto dopo aver risolto il conflitto. – quantka