Moving a git repo, into a new branch in an existing repo?
Hey all,
I've tried doing some Googling for this, but I think that I've been searching is too lengthly and isn't returning the results I'm after so I'm going to give here a go.
I currently have two separate projects (locally) that I want to merge into one, but separate the two into their own branches.
For now, I'm going to say my repos are both called project-black and project-gold
What I'd like to do is;
Take project-gold's master branch
Add this to project-black as a NEW branch
Allowing me to dispose of project-gold as it's now on it's on branch in project-black
$ mkdir awesome-project
$ cd awesome-project
$ git init
$ git checkout -b project-gold master
...add all source code for project-gold here, do whatever you like in this branch "project-gold"
$ git checkout master
$ git checkout -b project-black master
...add all source code for project-black here, do whatever you like in this branch "project-black"
$ git checkout master
Branch master is basically the holder for the other two projects; so it's best to be empty anyway.
So just switch to your project branch to work by issuing $ git checkout [project-branch] is enough.