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?

  • Bitbucket: fatal: HTTP request failed when trying to clone Git repo
  • Bitbucket giving credit to wrong person for commits
  • Jenkins - Get code from BitBucket with SSH
  • Cloning a repo at bitbucket.org
  • How to remove deleted files from git?
  • git push failing for certain branch names
  • What is the old command of git clone -c in git version 1.7.1
  • Git - How to auto push changes in a directory to another branch
  • Git subtree export and re-import woes
  • Should I rebase master onto a branch that's been pushed?
  • Howto sync database with git and git hooks and howto debug if it doesn't work
  • Recover deleted local repository, got source files with file recovery but not recognizing as Git
  • 2 Solutions collect form web for “Syncing a fork in Bitbucket, Branches and tags..how are they synced?”

    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.

    No, you’re only taking a copy of the repository. No branches or tags that you have in your fork will make their way over to the upstream copy of the repository if you don’t explicitly make that happen.

    Git Baby is a git and github fan, let's start git clone.