0

I have a fork of a project. The project has two branches: v1.0-test, v1.0-stable

In my fork I created a branch jira-118 from v1.0-stable with my code modification

I was requested to change my PR to v1.0-stable

I changed the base branch according to https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-base-branch-of-a-pull-request

However it added commits that are not mine (commits that are already in v1.0-stable)

Attempts to fix this has failed. Now my PR try to submit changes of 169 files instead of 1 file.

What I want to do is simply:

  1. Get branch jira-118 to be aligned with v1.0-stable (locally)
  2. apply my commit to branch jira-118 (locally)
  3. update the remote repo of my fork according to the local copy.

It should be simple but I can't find a way to do that.

HaloKu
  • 405
  • 2
  • 7
  • 17
  • Have you tried to `rebase` your changes upon `v1.0-stable`? – Ingo Steinke Dec 02 '19 at 08:00
  • yes.. This is what caused the 169 file changes to appear – HaloKu Dec 02 '19 at 08:56
  • @IngoSteinke tried this https://stackoverflow.com/questions/16306012/github-pull-request-showing-commits-that-are-already-in-target-branch without success – HaloKu Dec 02 '19 at 09:02
  • @Heloku It seems that v1.0-stable has less commit than your branch jira-118. make sure that you are raising your PR against the remote repo of v1.0-stable and not against the branch v1.0-stable of your forked repos. – Esha Dec 02 '19 at 10:07
  • @Esha What I want to do now is to make branch jira-118 the same as v1.0-stable then apply specific commit to jira-118. How can I do that? – HaloKu Dec 02 '19 at 10:08
  • If you are okay to create a new branch, 1. git checkout v1.0stable 2. git checkout jira-118-1 3. git pull upstream v1.0statable 4. git cherry-pick 'commit-id' 5. git push origin jira-118-1 or git push upstream jira-118-1 6. then raise PR against upstream jira-118-1 – Esha Dec 02 '19 at 10:30
  • @Esha I don't want to create a new PR. If that is the solution I can simply delete the branch and recreate it. – HaloKu Dec 02 '19 at 11:53

0 Answers0