2
I have an ubuntu development system using git to manage files, but I like to do my editing in QTCreator on a different (windows) system, so I have a windows network drive mapped to the ubuntu server.
However, it seems that whenever I save a file, it adds the execute flag on windows. Sometimes it changes from 664 to 764, and sometimes I've seen it change to 777.
So I've been doing a chmod 644 before I do my git add, but it's rather a pain in the ass, and sometimes I forget.
Is there a good way to either prevent windows/QT from adding the +x, or just have "git add" automatically chmod 664 my .c and .h files before staging/committing?
Thanks
Hmm, very dangerous haha. Had to git reset, it modified and added a whole bunch of other files ;) Is there any way to make it so that it only modifies the files which are already staged for commit?
Edit: Just saw the 2nd paragraph, yeah, that would be better. How would one go about that? I don't care about random permission changes except for the files that are being submitted – Jordan – 2013-11-25T23:50:05.623
@Jordan: The second para should use
git diff
. See updated answer. – Roland Smith – 2013-11-26T00:18:45.183Hmm, that seems to have chmodded the files after the commit, or at least not add the files with the modified permissions to the staged files. I tried doing "git add $FILES" but it didn't seem to like that – Jordan – 2013-11-26T22:08:02.540
@Jordan There might be a better way. See updated answer. – Roland Smith – 2013-12-09T22:35:19.380
Aha! That's exactly what I'm looking for. Thanks! – Jordan – 2013-12-11T19:48:06.643