1

I just set up a Beanstalk account and created a repository using git.

My repository is being used to hold different websites I am working on, and it will act as the staging server.

Repository
   - website1 
   - website2
   - website3

Inside of those folders are the websites active files. So when I commit any changes, I set it up to automatically deploy to the staging server FTP.

So I have:

developmentdomain.com/website1/
developmentdomain.com/website2/
developmentdomain.com/website3/

And then once it's good to go, I can push it to the live server for that domain. My question is... if a team member gets a task to work on website2, they have the option to work on the text editor built in to Beanstalk, but if they want to clone the files, how can they clone JUST the website2 folder inside that repository?

Or am I approaching this the wrong way?

Any help is appreciated.

Community
  • 1
  • 1
Drew
  • 6,736
  • 17
  • 64
  • 96

1 Answers1

4

You are doing it wrong, use different repositories for each website.

If the websites happen to have common code, put the common code into another repository and import it with git submodule in each website repository.

KurzedMetal
  • 12,540
  • 6
  • 39
  • 65
  • Really? See we have over 300+ websites, so that will be a ton of repositories. I figured the development server will just have directories for all our websites and we can have it in just one place – Drew Apr 25 '12 at 19:12
  • @Drew Putting unrelated files in the same repository isn't a good approach, all the websites would have their history commits mixed in the same repository. There's nothing wrong about having 300 repositories. This approach is the correct to organize your source code. Why does having 300 repositories worry you? – KurzedMetal Apr 25 '12 at 20:01
  • well github's max private repositories is 125, so I would have to go with Beanstalk which would be $200 a month. It's not necessarily the money, but I guess the time it would take to set up a repo for each website, and set up the staging deployment FTP and then production, and doing that for all these clients + the new ones we get on a daily basis. not sure.. maybe it might not be that bad. I'm looking at gitbucket right now, they allow free unlimited private repositories.. not loving the interface though, I really like beanstalk – Drew Apr 25 '12 at 20:14
  • You could create the repos through the [GitHub API](http://develop.github.com/p/repo.html) and automate the initial and subsequent creation of repositories with some scripting. I don't know about the repository limit, in their [Plans & Prices page](https://github.com/plans) they encourage you to send a mail to support@github.com if you need larger plans. – KurzedMetal Apr 25 '12 at 20:37
  • Beanstalk is a huge ripoff. You could just spin up a rackspace server and host all the repos you want there for ~$30/mo. It's going to be even harder to manage 300 websites within a repo than it will be to set up 300 repos. Just write a script to automate setting up the remotes. – John McDonnell Jun 02 '12 at 15:21