Can I ignore permission changes in SourceTree?

materemias July 9, 2012

I work on a few mercurial projects on windows/linux, and started to work on OSX with source tree. My problem is that SourceTree also shows file permission changes which are automatically made by eclipse I guess. My question is if SourceTree could ignore all the mode/permission changes.

3 answers

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2012

It's actually Mercurial that reports this difference, and it only tracks changes to the executable bit. Currently I don't believe there's an option to ignore this, there's a couple of discussions in the Mercurial lists here which may help, they suggest it's more likely a problem with using Cygwin on Windows.

http://mercurial.808500.n3.nabble.com/PATCH-posix-add-configuration-option-to-ignore-execution-mode-changes-issue3301-td3793313.html

http://selenic.com/pipermail/mercurial/2011-January/036537.html

materemias July 9, 2012

thank you for the answer, actually I have no such issue at all with Windows-Linux cross platform development, and since OSX eclipse changes all touched file modes from 100644->100755 I feel a bit lost.

since it is about source and copnfiguration files could a solution be that after I have a commit I do a chmod -R on the whole project directory and commit it as a changeset?

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2012

Hmm, so Eclipse is enabling the execute bit for every file? That's a bit odd - unless it's because you're doing web development and the files are being used for a development server in-situ? If the files are genuinely executable then it might be best to simply commit them with the execute bit set, which would get rid of the issue entirely.

materemias July 9, 2012

it is android development and all my java codes, xmls, images etc are changed when they are touched. I don't know if it is done by the OS or by Eclipse... strange.

still setting everything to 755 seems to be the only solution now. do you have any other idea?

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2012

No, other than reverting them back again or trying to find a way to stop Eclipse doing that I'm out of ideas. Are you sure it's not a badly behaved Eclipse plugin or something like that? If you're using Eclipse on other platforms and it's not doing that is seems weird. OS X definitely won't do it on its own.

materemias July 9, 2012

great, thanks.

5 votes
Ed Cramer February 5, 2013

Yeah, it's an old post, but duplicated posts aren't good either...

It's possible to convince SourceTree to ignore file modes, but it's a little tricky to find on your own. There's a post at StackOverflow about setting GIT to ignore file modes here: http://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-mode-changes-chmod

Since I'm using the "built-in" GIT client I can't run the commands suggested. Installing GIT separately and configuring SourceTree to use it might work, but I found something else that works. If you open the main/status window of a project in SourceTree, click on the Settings button in the upper right corner of the window. The resulting Settings dialog has an "Edit Config File..." button that opens the project's GIT config. Add filemode = false to the [core] section at the top of the file and you should be ready to go.

(Steve - your insight about Ecliplse/file permissions/web development is right on for me, but I'm not having any problems with random file mode changes.)

Wagner Büttner August 4, 2014

Thanks Ed! It worked for me!

Marco Bettini August 15, 2019

Thank you !!!

0 votes
materemias February 5, 2013

Hm, maybe it is done by Dropbox since I use that to sync my workspace...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events