Checkout in the git folder

I have a git project that I used for a recently published scientific article. In the project, I have doc subdirectories (divided into doc/paper doc/talks ) results src and much more.

Now I would like to publish my source code (but not my presentation slides, etc.). What is the best way to give people access only to the src subdirectory? I would release a zip file with a snapshot of the current src directory, but I want people to easily get updates.

Many thanks. Oliver

+4
source share
3 answers

Short version:

You need to use a separate repo on the top-level folder to which you want to grant access. See submodules for more information on how to do this.

"rare" checks may work, but I believe that this cannot be imposed on your users, who in any case should clone the entire repository to the local one, and then just get an incomplete working directory.

(You can also set up a separate repo that will automatically update and push changes to it, but you lose the ability to combine forks and corrections from your user base, which seems to be the point.)

Longer version: Wo "New" distributed version control systems (Git, Mercurial, Bazaar, etc.) Not built to check each folder in the same way as SVN and CVS. Having a branch tree separate from the directory tree simplifies branch processing and merging in the revision graph, since they are more numerous than for centralized VC: es. (SVN, IMO, processes branches and merges like a sledgehammer, processes a jar of spam, most of this is due to the fact that any directory in the hierarchy can be branched / merged).

The function of partial checks is easy to give in centralized scenarios, where you do not do branching / merging, and therefore are popular at dawn. You don’t understand this anymore and probably learn to be thankful for not receiving it. :)

Thus, facilitate several subrepositions / submodules of important material. Branching the top repo is a bit more complicated, so you need to think about how you want to tune the situation to make your job easier. (Maybe releasing presentation slides isn't that bad? :)

+6
source

It is not possible to check only the repository subfolder using git .

You can make the subfolder your own repository or distribute tarballs / zipfiles as you suggest.

As with git 1.7, there is support for "rare checks" - see here - but this is only a working copy that is sparse; you still have to give users the ability to clone your entire repository.

+4
source

As stated in the Git Book in the submodule chapter, Git does not allow partial validation.

You can just save your private repository and transfer src / development to a new, public one. Perhaps on github it has some community features - for example. error tracking, follow-up - this will simplify your subscribers.

+2
source

Source: https://habr.com/ru/post/1397635/


All Articles