2 Replies - 1308 Views - Last Post: 22 March 2013 - 11:07 AM

#1 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 170
  • View blog
  • Posts: 608
  • Joined: 12-October 09

Question about git and files outside the public web directory

Posted 17 March 2013 - 12:38 PM

I have only a little bit of experience with git, and that's just using it for pushing/pulling/merging, etc... I've never installed it anywhere.

The way we use it at work we have all the code for our system in one folder (www) so it's fairly easy to create a copy of that on our localhosts and push and pull up to it. However I am wanting to use git for a project of my own at home and the codebase for that is different, I have my main files (index, images, css, javascript, etc...) in the web root (www), but then I have all my important scripts outside of that directory so that they can't be accessed from the browser, e.g.

- cgi-bin
- conf
- etc...
- private
- - backups
- - includes
- - - - scripts
- - - - config
- - - - etc... basically my important scripts
- www
- - - - all the main stuff

So in this example the directories I want to have in the repository are /www and /private/includes

Is this going to be possible to work with in one repository in git? As so far I've only ever worked with having repositories over one folder.

Could anyone point me in the right direction to achieve this?

Thanks.

This post has been edited by Duckington: 17 March 2013 - 01:27 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Question about git and files outside the public web directory

#2 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: Question about git and files outside the public web directory

Posted 20 March 2013 - 07:17 AM

I think you're looking at this the wrong way. You're asking how you can adapt your repository structure to accommodate your existing development environment. You should be changing the configuration of your development environment instead.

All you really need is a single directory for your repository with your different types of files grouped into appropriate subdirectories. So instead of just /www, you might put your public files in /home/you/your_project/www, the private includes in /home/you/your_project/includes, and so forth. To make that work, you would simply set the appropriate file and directory permissions on your checkout dir and configure your server to read the files directly from that location. The exact steps to do that will vary depending on what web server you're using, but in any case it should be pretty easy to configure. Heck, you could probably even cheat and use symlinks if you really wanted to.
Was This Post Helpful? 1
  • +
  • -

#3 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 170
  • View blog
  • Posts: 608
  • Joined: 12-October 09

Re: Question about git and files outside the public web directory

Posted 22 March 2013 - 11:07 AM

Yeah I realised that a while after I posted it, but I don't think I can delete my threads. Thanks anyway.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1