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?
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.
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.
精彩评论