84

I'm using SourceTree as my git tool on Windows.

I have a main branch and a feature branch and I can't get SourceTree to perform a rebase when I have a conflict.

main looks like:

c1 -> c2 -> c4 -> c5

feature looks like:

c1-> c2 -> c3

I want to rebase feature so it will be:

c1 -> c2-> c4-> c5-> c3

There is a conflict between c3 and c5. I can resolve the conflict, but when I commit the changes I get a HEAD tag and looking at my graph I can see that feature branch wasn't rebased.

How can I get the rebase to work?

  • Just to check: Did you do a `git rebase --continue` after fixing the conflict? – Robert Rüger Sep 17 '14 at 10:33
  • @Robert - No, I clicked the 'commit' button. –  Sep 17 '14 at 10:35
  • 2
    I don't know about graphical interfaces to git, but the command line workflow would be to fix the conflict, add it to the index with `git add` and then continue rebasing with `git rebase --continue`. – Robert Rüger Sep 17 '14 at 10:39
  • In a moment of doubt, go to console and write `git status` and it will guide you (in this case `git status` will tell you "resolve conflicts and type `git merge --continue` – andrew.fox Sep 22 '21 at 10:49

2 Answers2

172

Unfortunately the UX path for the resolving conflicts during a rebase is quite poor in .

After you have resolved the conflict and have all of your changes in the staging area, instead of clicking commit, go to Actions-> Continue Rebase:

enter image description here

Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
  • 8
    It means you are done resolving conflicts and you want to continue the rebase – Philip Pittle Nov 14 '14 at 18:53
  • 4
    Note that "have all of your changes in the staging area" is very important. I had resolved all conflicts, but some of the changes where not in the staging area. Sourcetree just seemed to do nothing while a command line `git rebase --continue` showed the proper warning message. – Wim Deblauwe Feb 18 '15 at 14:06
  • 1
    After resolving conflicts in sourcetree, `git rebase --continue` in bash would give a prompt that a `git add` is needed. While this answer must be the expected way to continue a rebase with the GUI of sourcetree. – JonSlowCN Aug 25 '15 at 06:38
  • Can't find any such option in SourceTree > Actions in MacOS – coding_idiot Nov 03 '16 at 08:11
  • 1
    Wow this is such a bad UX. It stages most of the files which makes you think that you should commit them to finish the rebase. It even lets you commit! Ugh. Still I mostly blame git for being insane. – Timmmm Mar 07 '17 at 16:22
  • 2
    @Timmmm - ya, agree SourceTree could be a lot better at helping users understand what's going. – Philip Pittle Mar 09 '17 at 04:18
  • Uff this was helpfull! Switched to sourcetree 2 months ago and could not figure out how to to a good rebase with merge conflicts... – Pavel Kotlov Mar 20 '17 at 14:40
  • 4
    I've raised an issue, feel free to vote/comment if you want this improved in SourceTree: https://jira.atlassian.com/browse/SRCTREEWIN-7761 – CrazyTim Aug 15 '17 at 23:56
  • This is ridiculous, it should automatically continue as you as you marked it as resolved. GitKraken is way more inuitive for rebasing and it's much faster and smoother of a process. But at least this answer works, and is good to know. – TetraDev Sep 30 '21 at 23:30
8

After you have resolved the conflict and have all of your changes in the staging area, instead of clicking commit, go to Actions-> Continue Rebase:

In the latest version of source tree, after you have resolved the conflict and have all of your changes in the staging area, you have to commit first and then click on Actions -> Continue Rebase.

Lastly, you will see numbers near of Pull/Push buttons. It is normal. Just right click on your branch and select "force push" option to push your code. If you do not see "force push" option, you have to activate it on sourcetree.

canerkaseler
  • 6,204
  • 45
  • 38
pro_gamer
  • 186
  • 2
  • 9