0

I need to have an USB stick with a git repository on it because i may want to change things in the repo on several computers (centos and redhat)

The repository uses symbolic links so this stick cannot be formatted in FAT32.

Hence, I formatted my usb key in EXT4. But my computers don't share the same users (otherwise they would have been connected and i would use ssh to clone and stuff)

So, when I put a file on Computer A with user A', I cannot read it from computer B with user B' (and so on with C-C' D-D'...)

I though of making every file rwx for 'others', but git saves these rights and I don't want to have some text file being executable (it causes trouble while packaging with rpmbuild: it does not like x flag on text file and rightfully expects a shebang on top of them...)

Is there a way to avoid that? like an hidden universal group or something like that?

For information I cannot be root on all computers.

Any help appreciated :)

6
  • Could you try storing the repo as a bare repo on the stick? Not sure if that helps with the final permissions; you may have to chmod the bare repo contents before umounting the stick so that others have write access, but it shouldn't change the actual stored permissions (since Git anyway only stores executable bits for the owner).
    – slhck
    Dec 13, 2019 at 10:05
  • Related. Dec 13, 2019 at 10:06
  • @slhck I've thought of that but I wanted to avoid it because it means to clone the repo on every computer, hence starting to be complicated to merge to the stick because of my users not really used to git. I may have to do that... Dec 13, 2019 at 10:17
  • @KamilMaciorowski thanks for this link, I didn't came accross, I did not come across it during my research Dec 13, 2019 at 10:19
  • Git does not use symbolic links in its repository format by default. Do you really need them? Or did you perhaps create a non-bare repo on the USB drive?
    – Daniel B
    Dec 13, 2019 at 10:27

1 Answer 1

1

After somes tries, I solved my problem with @slhck solution, i.e. having a bare repo on the stick and clone it on each computer needed.

It has cons, like having to recompile some tools in the repo on each computer, and to be rigourous about pushing and merge, but it works.

This is an answer about my specific problem which was with a git repo. My Question title is wider and a promising related solution has been linked by @KamilMaciorowski

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .