Tracking file level In Git (files from multiple branches in the same directory)

Is there any script that allows us to remember the branch / commit separately for files in any directory so that you can simultaneously work with file 1 in branch1 and file2 on branch2 in the same directory and ensure that they are fixed accordingly. If not, I will implement it myself.

My plan is to have hidden checkout directories for various branches / repositories and fill out an explicit check with links to these files, so that they just perform their respective hidden branches, but the tips would be appreciated. This way you could do something like

mgit checkout branch1 filename/filegroup mgit add filename (automatically to it correct branch/repo) mgit commit (automatically to it correct branch/repo) 

Before someone tells me this is a bad idea or misuse of version control, consider the application:

So often when writing academic documents in TeX, you get loosely coupled files that you want to save in version control. The problem is that these files are linked and can benefit from the git info history / aggregation information, but often different versions of files must be selected independently. More often than not, you just want to work on option 1 of some paper, and also work on option 2 of another, but you also have situations where TeX combines several files, so it’s important to be able to choose options in one folder.

In short, you have a bunch of different files with different names that often come from each other (the thesis becomes a document), you benefit from the fact that it is in the same repo, but it’s inconvenient to have dozens of different checks to work on any versions of each file currently in need of attention.

+4
source share
1 answer

No, I do not think this is supported by git.
It could be a local hook, as a pre-commit one hook might try and verify the correct branch before allowing the commit to continue.

0
source

All Articles