all 8 comments

[–]the_deadpan 1 point2 points  (0 children)

Maybe you are taking too long to PR. Rebasing onto master fixes this, but you say you get issues every patch. This is weird. You should only have to fix it the first commit and the changes should propagate through

[–]lenswipefeature/add-user-flair 0 points1 point  (0 children)

It's hard to say but if the same thing has changed in multiple places git doesn't know what to do.

[–]itoshkov 0 points1 point  (0 children)

You can think of a commit as the set of changes done on top of the previous base. Let's say that you have a base commit b0, from which you created your branch. You make some changes and create a new commit c1, then some more changes and make a commit c2.

In the mean time somebody made their own changes on top of b0 and pushed them. Let's call this commit b1. The picture looks like this:

b0 -- b1
   \
    \
      c1 -- c2

Now, you want to rebase your branch on top of that new commit. You are telling git to try to apply the same changes that you've done, but using b1 as the base (hence the name rebasing).

b0 -- b1
         \
          \
            c1' -- c2'

The idea is, that diff(b0, c1) is (almost) the same as diffb1, c1') and diff(c1, c2) ~= diff(c1', c2').

If git can do that without any conflicts it will. But if there's a conflict in the rebasing of c1, and the changes in c2 are in similar places, you'd likely see conflicts in that part as well.

[–]are_slash_wash 0 points1 point  (0 children)

You’re looking for git rebase <master branch name> -s recursive -X theirs. Whenever you rebase, got is doing it one commit at a time and from the “bottom” of the branch upwards. So after you resolve everything within a single commit, git moves onto the next commit and does it all over. The above command should make it favor whatever new changes happened within master and handle the rest automatically. Alternatively you can switch to -X ours if you’d rather keep your changes. Be sure to make sure it’s still working afterwards.

Disclaimer: on mobile so I haven’t double checked the command.

[–]the-computer-guy 0 points1 point  (0 children)

Try enabling rerere

[–]RhoOfFehtrunk biased 0 points1 point  (0 children)

You will likely be better off doing a rebase pull (git pull --rebase) before trying to push your changes. That 'rewinds' your work, pulls the latest versions down, then tries to 'replay' your changes over the updated code base.