File permission issue with Mac/Windows when using git
This isn't really answering your original question, but I hope to highlight another issue I ran into when attempting to trying @drewag's proposed solution...
Another issue I ran into when attempting to ignore file permissions, regardless of whether it was on a Windows or Mac machine (more prevelant on the Windows machine!), was the problem global vs. project-level configurations.
Running this command did not affect the .gitconfig file in my C:\Users\Username folder:
git config core.filemode false
Although adding the --global flag did affect the change I was looking for:
git config --global core.filemode false
Hope this helps someone solve some of their headaches!
Git repo default ignore files permissions
Git ignores all permission bits other than the executable bit
(In other words, file and directory entries of git's tree objects have a permission mask of either 755 or 644 -- nothing else).core.fileMode
is only about the executable bit. You usually want those executable bits honored, except on some weird filesystems, in which case the user should turn core.fileMode
off by themselves.
From git help config:
core.fileMode
Tells Git if the executable bit of files in the working tree is to be honored.Some filesystems lose the executable bit when a file that is marked as executable is checked
out, or checks out an non-executable file with executable bit on. git-clone(1) or git-init(1)
probe the filesystem to see if it handles the executable bit correctly and this variable is
automatically set as necessary.
A repository, however, may be on a filesystem that handles the filemode correctly, and this
variable is set to true when created, but later may be made accessible from another environment
that loses the filemode (e.g. exporting ext4 via CIFS mount, visiting a Cygwin created
repository with Git for Windows or Eclipse). In such a case it may be necessary to set this
variable to false. See git-update-index(1).
The default is true (when core.filemode is not specified in the config file).
Can't Git Push to Mount Folder from Shared Windows Repository (Local Network)
i was searching for a few day..
and i have been found the answer of my question:
i just mount the shared windows folder with group and user owner:
sudo mount -t cifs -o username=someusername,password=somepasswrduid=vinra,gid=groups //WindowsServerIP/RepoFolder /mnt/windowsFolder
but thanks for @nwinkler for clue
Permission denied on network/samba share while accessing HG repo
chmod will not help you here I guess. The ownership and permissions on the server side are not replicated to the client (no unix extensions on server) or your UID/GID differ between both machines. You can override file ownership when mounting via:
mount -t cifs //SERVER/SHARE /MOUNTPOINT -o uid=USERNAME
This is from memory though, check man mount.cifs for details. Also, alternative networked filesystems like NFS might serve you better in this case, or try sshfs.
Related Topics
How to Create a Folder with a Folder Name Containing Spaces in Linux
Change The Rlimit_Nproc in Linux
"Sudo" Fails with "Sudo Requires a Tty" When Executed from Putty Command Line
Putting Extensions in a Certificate in Openssl
Why Would Vim Create a New File Every Time You Save a File
Find String Inside PDF with Shell
Grep If The Next X Lines Doesn't Contain a Specific String
Tar: Cowardly Refusing to Create an Empty Archive
How to Programmatically Know If I Am in a Vm
Can't Run Dmidecode on Docker Container
How to Sort Files in Paste Command
Shell Script Linux Substract Parameter Grep
Command or Option for The Xgettext, Msginit, Msgfmt Sequence for Setting The Mime Type
Kaldi Toolkit Installation Error on Ubuntu 16.04
How to Boot with My Latest Rpi-3.18.0 Kernel and Enabling The Device Tree