0

Okay so in my local file structure I have a folder named "X", inside that folder I have 4 other folders: "master", "demo", "deployer", and "gh-pages".

I am trying to set it up so that each of this folders is responsible for each of those equally named branches I have.

EDIT

Thank you for the answers so far, they have been truly insightful. I just need a bit of a in-depth coverage on the topic. I never used a versioning system before.

Luiz Berti
  • 1,421
  • 1
  • 15
  • 24
  • As mentioned in answers, you must be an svn user. However, you can achieve what you've asked with orphan brancehs. `git checkout --orphan demo` will create a new branch with no parent commit, just like if you are initializing a new repo. You can `rm -rf` all your working dir and create completely new history, while having all other code in other branches. I bet you already have one orphan branch named `gh-pages`. It's content is completely independent from other codebase. – madhead Jul 09 '13 at 22:11
  • You can find a good book about git [here](https://github.com/progit/progit). And [here](https://help.github.com/articles/creating-project-pages-manually) you can find a bit of info about orphan branches. – madhead Jul 16 '13 at 12:05

2 Answers2

2

i assume you come from a svn background, because there (as opposed to git) branches are folders. in git the two do not have anything to do with each other and branches are first class citizens.

thus i would do without the folders "master", "demo", "deployer" & "gh-pages" and just make those four branches and put the respective files on the top level.

mnagel
  • 6,729
  • 4
  • 31
  • 66
  • Thats what I want to do, my "master" branch currently has all of the folders at the moment. You can see my project [here](https://github.com/luizfb/WebDK) for a better idea, I want to have the contents of each of those folders at the top-level of the respective same-named branches. I just don't have a clue on how to accomplish that. By the way, I have never used SVN before either, GIT is my first try at a versioning system. I'm a total newbie at this. – Luiz Berti Jul 14 '13 at 16:57
  • create 3 additional branches at the current state, then check them out one after the other and remove the extraneous folders and commit. – mnagel Jul 15 '13 at 07:09
0

Suppose remote has following branches:

remotename/master 
remotename/master-lastgoodbuild 
remotename/master-stablebuild 
remotename/master-experimental 

I am assuming you want to clone each branch in to its own folder. Did you try:

git clone <remote-url>.master localfolder1 
git clone <remote-url>.master-lastgoodbuild localfolder2 
git clone <remote-url>.master-stablebuild localfolder3
...

Is this what you are looking for?

Bhaskar
  • 2,549
  • 1
  • 21
  • 23