0

I created a fork from repo ABC, and made some commits to the origin:master. Someone created some changes to the upstream master that I wanted to sync with. There were specifically two commits on the upstream master, and at the top of the forked repo it said the following: This branch is 3 commits ahead, 2 commits behind <original-location>/ABC:master. On my forked repo, it has a button, "Fetch upstream" that will allow you to open a pull request with the upstream changes (for clarity because I had conflicts my only option was the "Open pull request"). After doing so, and fixing the conflicts, it asked if I wanted to merge the changes right away into origin:master, or open up a separate branch. I opted for the separate branch, because I wanted to formally see the changes, and add people for awareness of what I was doing. After reviewing, everything merged( I used "Squash and merge" specifically) smoothly, and you can see the changes reflected in origin:master, and in the commit history. However at the top of the repo it continues to say that it is 2 commits behind the upstream master, but they are the same 2 commits.

This is my first time with syncing changes from upstream to a fork. I was wondering if anyone had more experience with this, and could give advice on what I might have done wrong, or if I did something that was generally bad practice.

I did the sync process again without officially committing, for sanity, but there's now no changes to show for second time around, which makes sense since the changes do in fact exist in the origin master.

I have also read how to update a fork, but it isn't quite what I am looking for.

Thank you for any advice or clarity on syncing with an upstream master.

JackR
  • 141
  • 10

1 Answers1

-1

Okay so as I was thinking about what could have been wrong, it looks like when you want to merge commits from an upsteam master using a new branch you created, you get three option:

  1. Create a merge commit
  2. Squash and merge
  3. Rebase and merge (which isn't really an option)

After redoing the sync, I found that the way that it properly recognized that I had synced with the upstream master is when I did a merge commit, so that the individually commits showed up in my commit history instead of them being squashed into one.

After I did it this way, "Fetch upstream" showed that there were no new commits to fetch.

JackR
  • 141
  • 10