Inx51 Inx51 - 13 days ago 6
Git Question

Syncing a fork in Bitbucket, Branches and tags..how are they synced?

I'm quite new to the whole forking "thingy".. I get the basics of the concept, but the part I don't get is: What happens to all the branches?

Lets say that I decide to fork a repository; the original repository adds a bunch of new branches, which I assume my fork won't be automatically updated with. Then if I decide to sync my fork with the original one, will this overwrite the newly created branches on the original? Or will they stay intact as long as I don't have a branch called the same thing located in the fork-repo? Is it the same regarding tags?

Answer

What happens to all the branches?

All the branches are located on your server (bitbucket in your case) once you have "published" (git push) them to the server.


Lets say that I decide to fork a repository.. then the original repository adds a bunch of new branches (which I assume my fork won't get updated with automatically).

You are right on this, they will not be updated automatically.


Then I decide to sync my fork with the original..
will this overwrite the newly created branches on the original?

Nope, in order to get the latest updated you will have to pull the changes from the original repository. since pull is fetch + merge you will not "lose" your code. it will be merged together.

But

You cant publish your code to the original repo unless you are contributor to this repository. you have read access but not write access to it.