GIT - noduslabs/un1v3r53 GitHub Wiki

I want now to separate that branch into a separate project, which could be synchronized with the original project, so when I make some changes in the original project, i could also pull them to the new branch (but not the other way round).

  1. Create a new project in GitHub

  2. In your existing project, check out the branch of interest.

     git checkout mybranch
    
  3. Push it into the master branch of your new project:

     git push [email protected]:username/project.git mybranch:master
    

Now the master branch of your new project contains the history of mybranch in your exist project.

To keep the new repository in sync:

  1. Add it as a new "remote" to your existing repository:

     git remote add otherproject [email protected]:username/project.git
    
  2. When you make changes to mybranch, push them to the master branch of otherproject:

     git push otherproject mybranch:master