Problem with git rebase

Hello, I got a problem with git --rebase, when i did a git pull --rebase i ended with a 6 different commits, so I did a git rebase -i head 6 and everything seems to work just fine… but when I tried to make a MR I end up with more than one challenge per MR so my MR got reject… why can I do to fix this?

1 Like

When you use an interactive rebase you must flag the commits you want to squash, fixup, pick or drop by adding one of these words at the begining of the line, did you use this? what was the outcome?

Hello, I used it… the problem was that I was squashing old commits
how do I know since which commit I have to squash?

Old commits should be squashed automatically when you run a $ git pull --rebase you should squash, fixup or drop only your own commits. Try running a $git rebase and paste here your results to know what’s happening.

remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 18 (delta 12), reused 9 (delta 3), pack-reused 0
Desempaquetando objetos: 100% (18/18), listo.
09b7a0c7f…9e0d9642c master -> origin/master
f01ec5341…9ac78bd9e jdiegoc -> origin/jdiegoc

  • ed1e06b2b…d257fe2c1 mrsossa -> origin/mrsossa (actualización forzada)
    Actualizando 09b7a0c7f…9e0d9642c
    code/codeabbey/035/{jdiego10.jl => jdiegoc.jl} | 4 +±-
    code/codeabbey/054/{jdiego10.lua => jdiegoc.lua} | 6 ++±–
    2 files changed, 5 insertions(+), 5 deletions(-)
    rename code/codeabbey/035/{jdiego10.jl => jdiegoc.jl} (91%)
    rename code/codeabbey/054/{jdiego10.lua => jdiegoc.lua} (90%)
    La rama actual calderonsin está actualizada.

Your branch was behind master all the time, with that git rebase your branch should be up to date. if you run $ git rebase again you should see your actual commits, try pushing them and not the old commits, the trick is to apply git pull --rebase before every push

1 Like