0

Is it possible to track only your remote directory for a website? I know how to track a local directory, but I do not wish to download all of my remote files associated with the website of interest -- or is this what I should do when editing 500+ files of code?

I am new to web dev/coding by the way.

ADDED: Basically, I just want to know if I need to download my entire website to my computer in order to be able to track all code that I edit.

I am assuming that I can just create a local git repo and then download select files that I want to edit and then add other files I want to edit as I go?

Albert Ko
  • 3
  • 2
  • What's the exact situation? What's on the remote git repo, and what do you want in your repo? – nneonneo Aug 13 '13 at 04:37
  • ahhh so in order to not download my whole website to track as a local repo I would need to subscribe to a paid/private git repo hosting service like github right? – Albert Ko Aug 13 '13 at 04:41
  • 1
    the whole point of git is that you have a copy of all of the files and all of the changes on your machine so you don't need to talk to a server – Daniel Powell Aug 13 '13 at 04:42
  • If I understood correctly, this is a possible dupe: http://stackoverflow.com/q/600079/422353. The answers seems to be that git can't do this. – madth3 Aug 13 '13 at 04:50
  • Okay, so even if my website grows exponentially to a large size, it is "normal" to download all of the files to my computer (to edit and track with Git), correct? – Albert Ko Aug 13 '13 at 04:54
  • if your website is growing exponentially I think thats a much larger issue and you are probably checking things into source control that don't need to be there (binaries etc), – Daniel Powell Aug 13 '13 at 10:10
  • if you were doing 3d animation development or something similar it might be feasible but I believe its somewhat a consensus that git might not be the best tool for something like that – Daniel Powell Aug 13 '13 at 10:11

1 Answers1

0

All of your code should be version controlled, with pretty much no exception besides generated content. Not doing so seems rather counterproductive.

If you do want to track just a single directory, make it into its own repository. If you're talking about static assets, you can consider adding your asset directories to .gitignore and distributing them via another channel.

To address your added question: your repository should maintain a single state across your machines, i.e. every machine that accesses the code should have a copy of the entire history of the project and its constituent files. That's pretty much the essence of DVCS. When you want to deploy, you pull in the delta from your local copy to the production server.

jli
  • 6,523
  • 2
  • 29
  • 37
  • Okay, I understand it better now. Is there another kind of VCS (Perforce?) that allows one to not have to keep a local copy of the entire website and instead just extract individual files when one wants to edit the code just in that single file? Or would this kind of software destroy the whole point of VCS? – Albert Ko Aug 13 '13 at 05:00
  • @AlbertKo Such a system would be orthogonal to VCS at that point — you're basically asking for (S)FTP. The current standard practice is to develop locally (i.e. run a local server) and not directly on production or staging servers. The days of editing those PHP files with Dreamweaver over FTP are long over :) That said, most VCS software does have some sort of a sparse/partial clone mechanism, but it's not a standard practice to use it. – jli Aug 13 '13 at 05:05