Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree files without changes need to be committed

dsmoore1600 August 21, 2013

I have a project that is hosted in stash, that I use Sourcetree to interact with, for some reason files will randomly decide that they need to be committed, but if I look at the diff nothing shows up unless I allow whiltespace to be compared. I have done some searching and almost everyone points to this being an EOL problem, but these files haven't been touched by anyone and they are different everytime that they pop up. Can anyone help me resolve this situation? Thank you.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
cofarrell
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.
August 21, 2013

Hi David,

That sounds a little unusual. Just out of curiousity what is the difference when you turn on whitespace? Is it just the last line, or all the end of line markers as well?

The important question - if you run 'git checkout file', does git still show the file as having changes? I've seen this before when you have certain Git attributes enable, which result in Git trying to 'normalise' files for you.

Are you on Windows, and if so what is the output of 'git config core.autocrlf', or maybe 'git config --list' regardless? Alternatively do you have any .gitattribues files in your repository and if so what do they contain?

Sorry for the 20 questions. I hope we can help fix the problem.

Charles

dsmoore1600 August 21, 2013

The following is the output of git config --list (without branch information)

$ git config --list
core.symlinks=false
core.autocrlf=false
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
merge.tool=kdiff3
mergetool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
diff.guitool=winmerge
difftool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
core.autocrlf=true
credential.helper=!"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/g
it-credential-winstore.exe"
user.name=David Moore
user.email=david.moore@yourcls.com
difftool.winmerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe
difftool.winmerge.cmd="C:/Program Files (x86)/WinMerge/winmergeu.exe" -e -u "$LO
CAL" "$REMOTE"
gui.recentrepo=C:/Integration/Genesis
difftool.sourcetree.cmd='C:/Program Files (x86)/WinMerge/WinMergeU.exe' "$LOCAL"
"$REMOTE"
mergetool.sourcetree.cmd='C:/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe'
-base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED"
mergetool.sourcetree.trustexitcode=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=http://david@software.yourcls.com:7990/scm/gen/genesis.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
gitflow.branch.master=master
gitflow.branch.develop=develop
gitflow.prefix.feature=feature/
gitflow.prefix.release=release/
gitflow.prefix.hotfix=hotfix/
gitflow.prefix.support=support/
gitflow.prefix.versiontag=

Thank you for your assistance, and please let me know if there is anything else that I can provide.

dsmoore1600 August 21, 2013

When I turn ignore whitespace off, I see the entire file, but I can't see any differences, and then when I turn the ignore whitespace back on, the file disapears.

If I run git checkout file, it is as if nothing has happened, the file is still marked as having changes.

I am on Windows 7.

The output of git config core.autocrlf is true

.gitattributes

* text=auto !eol

After this line, there are lines that have all of my file names followed by -text, but then there are some strange ones that have this: [!!-~] instead of spaces in the file name.

The git config --list follows:

cofarrell
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.
August 21, 2013

Hi David,

Well you've certainly got a few suspects. The !eol is for making sure that your file are checked in with LF. Are the files that are listed manually all binary files?

http://stackoverflow.com/questions/10734395/git-default-all-text-files-to-unix-line-breaks

What happens if you run 'git config core.autocrlf false' (you may want to enable it again afterwards) and then running 'git checkout file'.

http://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git

I'm curious who is adding all your files to the .gitattributes file. If you run 'git log .gitattributes' it will tell you who has been playing with these settings - you might want to go and speak to them as well.

Sorry I can't be more help. Honestly I haven't played enough with these settings - but this is certainly where the problem is. There is a fair amount of documentation and questions around these Git settings on the web that might tell you more.

Cheers,

Charles

dsmoore1600 August 21, 2013

Charles,

Thank you for the advise, I deleted all of the entries within the .gitattributes file, and so far my problems have left as well. I belive that the entries were made when we switchted from SVN to GIT.

Thank you again,

David

cofarrell
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.
August 22, 2013

Hi David,

Glad to hear it. Just keep in mind those attributes can be useful, depending on the context. For example if you don't have any .gitattributes, people on your team could be committing both LF and CRLF line endings, and git won't ensure they get converted to LF. I would probably make sure that everyone on your team has the same core.autocrlf setting (if they're all on Windows).

Who knew line endings were so painful. :(

Charles

0 votes
dsmoore1600 August 21, 2013

Please let me know if there is any extra information that I can provide, I am new to Stash, SourceTree, and Git, so I may have easily left out some crucial piece of information.

TAGS
AUG Leaders

Atlassian Community Events