Why does my forked repo show as ‘3 commits ahead’ after merging and syncing, and how does this affect future pull requests?

  Kiến thức lập trình

I forked a project, cloned it to my machine, made 2 commits, pushed them to my forked repository, and then created a pull request to the original repository. Initially, my forked repo showed as 2 commits ahead of the main repo, which made sense since I had made 2 commits.

After my pull request was accepted, my forked repo began showing as “2 commits ahead, 2 commits behind,” even though no new commits had been made to the main repo. This was confusing because I had only made those 2 commits and the pull request was accepted.

When I clicked the “Sync Fork” button in my forked repo, it now shows as “3 commits ahead” of the main repo. This includes the 2 commits I made and an additional merge commit.

Here are my questions:

  1. Why does my forked repo show as “3 commits ahead” after syncing, even though the goal of syncing is to align both repositories?
  2. If my forked repo is 3 commits ahead, will any new commits I make in my forked repo be included in future pull requests to the original repo?

I was expecting that now my forked repo will show that it is in sync with the main repo.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT