shin
shin

Reputation: 32721

Location of directory using git on ubuntu

I started using github on Ubuntu. I use PHP/MySQL.

All my applications are in /var/www directory for development.

Now should I create .git directory in each application in /var/www/, such as /var/www/myapp1/.git ?

Or should I copy each application to /home/MyGit/ and create .git directory here?

How are you doing?

Please let me know. Thanks in advance.

Upvotes: 4

Views: 30484

Answers (3)

jrlmx2
jrlmx2

Reputation: 1987

Traditionally people have used git to track a single project, so creating a repository for each applications would be the way to go if you like to follow tradition. Unless your entire www folder is an application, I wouldn't make one big git repository.

Upvotes: 0

Jonathan
Jonathan

Reputation: 13614

You should use Git to store source code, which should be separate from production code. So you should have a /home/you/src/appname directory with the source code, which is where you should initialize Git.

When you are happy with an update, check it into Git and copy it to /var/www/.

Upvotes: 2

Micah Carrick
Micah Carrick

Reputation: 10187

You can do whatever your preference is.

Personally, I have all of my projects under my home folder and if I do any local testing from /var/www I use a symlink. The reason for this is because my /home directory is mounted on it's own partition and is backed up. So I can re-install Ubunut, wiping out the contents of /var/www, and simply restore my symlinks. My .git repositories are created wherever I have that project within my home directory.

Upvotes: 0

Related Questions