Home > database >  what happens to the remote history if I merge local branch to main
what happens to the remote history if I merge local branch to main

Time:02-02

I have a remote branch (main), and I have 2 local branches (main and my_feature).

I am working on "my_feature" branch, and when I finished I want to merge it into "master".

What happens to the remote "main" history for all other developers that don't have "my_feature" branch? They will see my local branch?

CodePudding user response:

When you merge your local "my_feature" branch into your local "master" branch, and then push the updated "master" branch to the remote "main", other developers who have pulled the "main" branch will not see your local "my_feature" branch. Instead, they will only see the changes made in "my_feature" as part of the new history of the "main" branch. Your local "my_feature" branch will still exist on your machine, but will not be reflected on the remote repository or other developers' machines.

CodePudding user response:

The other users are not going to see your local my_feature branch unless you push it explicitly to the remote repository.

Once my_feature is merged into main and main will be pushed to remote repo the other users are going to see my_feature's commits history as part of the main-branch' commits history.

As unwanted advice, consider to have a branching/PR-reviewing strategy agreed by you and the repository's other users. In my own experience code which is not reviewed, devs who work alone and no testing is very painful in the end (both for code and for devs growth) :)!

  • Related