i have a repo setup with a directory structure like this:
FOLDER1/
/.git/
/fldrA/
/fldrB/
How can I setup one of the subfolders as a submodule, so one of the users can check out only that section?
You've got a wrong understanding of submodules:
Mainly a submodule is a standalone git-repository, which can be used as a submodule within any other module.
In your case, you have to isolate the desired folder to a standalone git-repository and your main project ("Folder1") has to use this standalone repository as submodule.
Splitting a subdirectory into an own repository is described for example here
You say I do not understand but you explain exactly what I said ... at least to me .. my feeling about most software is I dont care much why it works, i only care how to use it ... so your answer sounds perfect to me .. all i want is to be able to pull from the top level, and have other people pull from an inner folder .. it sounds like this is possible .. thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not quite sure, I've got you correctly.
You say: "all i want is to be able to pull from the top level, and have other people pull from an inner folder"
I say: it's not possible to do this in a direct way - the desired "inner folder" has to be a repository on it's own. You have to incorporate this repository within your top level repository as submodule - and other people can use this repository directly.
I assumed you already have a git-repository with the structure described in your initial question. Starting from this point an inner folder of your project cannot be used as separate repository by other users. What I described is a way to split your inner folder from project to a standaone repository and incorporate it as a submodule in your project repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Johannes, yes thank you .. what you are saying is perfect .. all i have to do is make my "inner folder" a repository, then i can include it as you say .. i will have access to the top level, and i will make the inner folders a submodule .. noone will know the top level url so i can keep some things hidden ... again, i am an engineer, so i don't know or care what you want to call it, or if it is ideal or not, i am only interested in a practical solution, it sounds like you have given one .. unless i am missing something ... thank you i will try .. i think it sounds perfect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding to Johannes answer I'd also suggest reading the "Submodule" chapter in the Git book here: http://git-scm.com/book/en/Git-Tools-Submodules
This will help you understand submodules even further, but Johannes is correct about them in the short term.
Good luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have read that section, the problem is all the git documentation is all text based, and I am not interested in doing anything via text commands .. this is why i use SourceTree and why I posted the question here, and not in the git google group .. i want to know how to do it from SourceTree .. the documentation explains things ok, but it does not help me with SourceTree .. too bad there is no SourceTree documentation ... if there is, where is it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If what you're trying to do is add a submodule you can simply context-click in the sidebar and hit "Add submodule" as follows:
Following this you'll see the add submodule sheet where you enter the URL for the submodule repository and you can enter a relative path to your local repository. In your case you'd specify "fldrA" as the relative path.
The source path allows you to choose a repository from your hosted repositories too.
Hopefully that makes sense.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.