I have on system A a (remote, read-only mounted from server B via sftp/sshfs) filesystem with data on it that needs to be pushed to a remote git repository regularly.
I was not able to find a git command that just takes the contents of a directory (and its subdirectories) and pushes it to a remote repository, without turning the local directory into a repository itself (which would require writing into the locally mounted read-only directory).
One could maybe put an overlayfs on top of the remote directory's mountpoint on server A but I read that changes on lowerdir (which will happen on server B) could occasionaly cause issues with stale file handles which in turn can sometimes only be fixed by rebooting the machine (A).
Due to the large amount of data that needs to be pushed, temporarily copying it to the local machine A and git-pushing from there is not an option.
EDIT: The files are hosted on server B in a restricted network with no access to the git repository.
.git
subdirectory, so maybe (I haven't tried) you can make a directory somewhere you can write and symlink.git
to that.