this is my first time asking a question on here. I want to preface this by telling you that I am a complete noob in a junior role, learning as I go.
I have been tasked with setting up some sort of version control. I need the ability to checkout only one file at a time. My leadership thinks having to clone or checkout an entire directory (as seems to be the case with GIT) is a little dangerous.
I managed to setup an SVN repo and checkout a single file using Tortoise SVN. So I am thinking this will be the product I will use going forward. I am confused about a property that both SVN and GIT share, however.
It looks like when I create an SVN repo, it is similar to a bare repo in git in the sense that I cannot see any files that are stored in my repo. I can see them if I use SVN list or checkout, but if I navigate to the repo itself, the files are not listed.
Why is that? I know it doesn't contain a working tree, but what use is a repo that I can't access my files in? If I have a program that uses a config file in one of these repos, how is my program supposed to find the config files in that repository?
Thank you so much in advance for your help!
CodePudding user response:
If you think about it carefully, your question answers itself:
- You checked out one file, rather than the whole code base
- Now you have one file checked out, not the whole code base
It's not Subversion and git that are making the decision to exclude the other files, it's you.
The idea that "checking out an entire directory ... is a little dangerous" suggests a lack of understanding - or perhaps a miscommunication - on your manager's part. The point of version control is to keep track of the versions of all the files you need to work with; generally, that's the entire source code of a particular application, library, module, etc.
One possibility I can think of is that you're misunderstanding what "check out" means, and assuming that this will "lock" the file in some way. In most modern version control systems, there is no such locking, and "check out" simply means "fetch a particular version of this file". So generally you check out a particular version of the whole source code in order to work on it, even if you're not going to edit most of the files (or indeed, any of them - you might just be testing something in a particular version).
Another possibility is that there are files that developers shouldn't have as part of their local copies. If so, they shouldn't be in version control at all; developers shouldn't need to choose which files to check out when.
I suggest stepping back and looking at what requirements you actually have, as well as reviewing some tutorials on what version control is for and how to use it effectively.