I am trying out a new setup where the code lives primarily on my NAS, mounted via SMB, and that results in every file in every repo appearing to have been changed, when it is really 644 => 755 permissions. So I want to globally ignore filemode.
Oh, does that sound familiar. I had the same problem ~10 years ago when I built my first NAS.
Where I landed was to ditch SMB (and then later ditch NFS) and installed a local git server. I now have Soft Serve running in a container on a Raspberry Pi 4B+. It is awesome. Lightweight, easy to work with and no more SMB perms / auth errors to administrate.
Ignoring the filemode is not really what you want. I am just saying.
Don’t forget about time as well … make sure your desktop and NAS server are using the same time source, one does not have more latency than the other, etc. Experimentation is a great way to learn. I did the same thing. But then gave up on SMB (and NFS). I didn’t need another job.
Note I am not commenting on what you are doing to try to solve your SMB problem - just how you are going about configuring git.
The purpose of git config --system ... (/etc/gitconfig) is to provide baseline config for all USERS of your system. So unless you have multiple USERS that need to use git operations against your mounted dirs, than you really do not need to do that.
In my case, I mounted my source dir as ~/src and only my user (my own policy) was allowed to perform git operations on those dirs. That kept everything in my home dir where it was easy to backup/restore (or exclude from backup).
So git config --global ... is what I use. This writes to ~/.config/git/config if that dir exists or ~/.gitconfig if it does not. Note you should create the ~/.config/git dir manually before using git config --global set ....
That interpretation of the word “global” is all I needed. Then when I moved to bluefin I did not need to change that behavior at all.
For my git setup, “global” means $HOME.
Thanks to @JohnAtl for referencing the docs so I didn’t need to. I also find the arch wiki really helpful. Samba is Samba regardless of the OS on which it is running.
Yeah, that’s entirely accurate. I have been trying to move into this new atomic world since I found it a few days ago, and all my work drives were encrypted APFS, so I couldn’t access any of my TB of data until I moved it over to a drive linux could read. I tried apfs-fuse; it did not work at all.
Part of me wants to setup the NAS for remote access - but the reality is I don’t think I’ll get to it. I should give up on the SMB. Thanks for talking sense into me!