4

Coming from an SVN background Git is really taking some time to get used to. I really enjoy it, but I'm still trying to figure out how to use it in different situations. So here is my question:

My PHP framework of choice is CodeIgniter. I plan on building my personal website off of CI and I was thinking the best way to do this would be to clone CI and build my website. I'd be doing this because I really want a super easy way to update the CI framework. I'm just not sure if this is really the right way to use cloning or if there is another tactic I should be taking. I was looking into submodules a little bit, but that doesn't really seem to be the correct way to go either. Help?

Mat
  • 202,337
  • 40
  • 393
  • 406
JoeCianflone
  • 682
  • 4
  • 18
  • What you want is a good deploy method, which has already been [answered very well](http://stackoverflow.com/questions/279169/deploy-a-project-using-git) - at least I do not know of any better solution. – Lars Aug 27 '11 at 17:43
  • “to clone CI and build my website” What do you mean, you want to add your code to the CI repository? – svick Aug 27 '11 at 17:45
  • No, I don't want to add my code to the CI repo. I really want it to be a one way relationship. I want my site to be built using CI and I would like to be able to pull updates into my site as CI updates, but I'm never going to do a pull request. Does that make sense? – JoeCianflone Aug 27 '11 at 17:51

2 Answers2

1

Considering that CodeIgniter has a GitHub repo, sure, you can clone it directly in your server, at the place mentioned by the Installation page.
Although for pure deployment purpose (i.e. for a code base I won't make any updates to, and won't push back to a remote repo, I prefer downloading an archive from the tarballs provided by GitHub for each project).

But that should be separate from your project (with your views, controllers, models, ... from your "application"), which should be in a separate bare repo on the same server, and cloned locally on your workstation.
Then, the deployment method mentioned by Lars in the comment takes care of the rest.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • SO what you're saying is clone CodeIgniter and fork my CI repo to build my website? – JoeCianflone Aug 27 '11 at 18:22
  • 2
    @JoeC: no, CI is just a *framework* you don't need to fiddle with. You just need a copy on your server. What you need as a separate project (and separate Git repo) is your own CI *application* that will need to be deployed on the same server within the CI framework, in order to be visible. – VonC Aug 27 '11 at 18:26
1

Sorry, I did not really understand Git/GitHub, this question was poorly asked on my part. I was considering just deleting it, but I think my answer here might just help other SVN developers who are starting to venture into Git/GitHub.

Basically, I want to work with CodeIgniter and be able to pull in updates from the CI Master Branch. The workflow that I need is very simple: Fork CI and Branch my fork to create my own personal websites. By doing this, I can pull in updates from the upstream CI branch, keeping my framework codebase up-to-date.

Branching is so crappy in SVN that just the concept of branching with Git seemed insane, now that I understand more about Git, I realize that branching is all I really needed. Duh. Anyway, hope this helps anyone coming from SVN. Branching is dead simple and fast in Git...don't over-think it.

JoeCianflone
  • 682
  • 4
  • 18