Reputation: 313
This is just two questions about how people out there structure their work:
1) Is it good practice to have your git initialised inside a sublime text project folder?
(In the past I sometimes had my repository as a separate copy from my project folders. When I put something in repository I usually copied it across to a repository folder. - But I see a lot of folks having git files inside the folder of the project they are coding on, and no duplicate folder or separate repostiry on the machine...)
2) How many folks here by default work from their local server, i.e have their entire workspace under their local server (for example under ZWAMP or WAMP)
(Again, I usually make a copy over to local server when I need to test, does that seem odd.)
Asking the two above as I'm considering a more organic workflow. Views welcome At the moment I'm thinking that I should adopt 1) but not adopt 2)
Thanks
Upvotes: 0
Views: 267
Reputation: 4816
Git is just a method of version control for your files. Since your files are housed in a project folder, it makes the most sense to initialize a Git repository in the project where the files live. Copying files out to another repository defeats the purpose of using version control because you can still have multiple edits in a file that are not tracked simply because you did not move copy the files.
It's best to keep a single set of project files, initialize a repository in that directory, and let Git do what it does best.
[EDIT]
To answer your question a little more closely:
When I'm working on a local WAMP server, I keep a directory in my web root for each project that is a git repository. I then create an entry in my Hosts file pointing the domain name for the site back to my local machine and I add a domain to Apache that points to the directory where my project is located. When I push the site live, I only need to remove the Hosts file entry to see the live site. If I'm working with a local copy and a live test server, I'll use a subdomain in my Hosts file instead so that I can access both at the same time.
Upvotes: 1