1

I read this SO topic, and am in the same situation myself. My question is, if I push the branch to a new remote, will it still have the commits that it had when it was a branch of the original repo?

svm96
  • 55
  • 8
  • 2
    you cannot push a project to a remote, you cannot however push a branch. And when you push a branch, you push its commits – smarber Jul 17 '17 at 10:09

1 Answers1

1

Yes. (Really, that's the answer.)

When you have a branch in a local repository, it's a branch in a local repository. It's never a branch in the remote repo (though you may have remote-tracking branches in local repo). You can push a local branch to any number of remotes.

You can have one upstream branch for every local branch, but it's not remote branch — it's a remote-tracking branch in local repo. But you can also have zero upstream branches. Even if a local branch has an upstream branch that doesn't prevent pushing the branch to any number of remotes.

phd
  • 82,685
  • 13
  • 120
  • 165