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

Lots of unstaged files on macOS

Gerardo Reichl November 27, 2016

I have a git repository, and everytime I come back to work (and my teammates made some changes on the project), I get like 5k unstaged files (.h, .meta, .htm, .png, .info, .cpp, .bin, .assets files that they did not modify) that I can't discard (or if I would, that would take me like 30min and my mac freezes). Im on Mac OS 10.12.1, Sourcetree 2.3.1, my friends are using Windows. This is so annoying becouse it's not easy to find the files I want to stage in a list with more than 5k files. I have come to have more than 35k files, help plz!

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Johannes Kilian
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.
November 27, 2016

Your problems most probably result from line ending conversions performed by git.

You might have a look at http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ - this is a nice article on the correct settings with lineendings using git (espacially when your team is working on your repository with different OS (MacOS-Windows-Unix)).

See also for example:

Be aware, that applying those settings also make sense with your coworkers ...

Gerardo Reichl November 28, 2016

Hey Johannes!

I'm replaced the CRFL by LF in my files and did what the last link you posted says:

ttps://help.github.com/articles/dealing-with-line-endings/

I think my problem is solved with this.

First I tried the other links, buy my unstaged files when from 3k to 16k. But then, it was all solved with the third link.

If I have the same problem once more, I'll try to do the same.

 

Lots of thanks!

 

Gerardo Reichl

Johannes Kilian
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.
November 28, 2016

Glad I could help - good luck in the future wink

 

My recommendation to "my" InHouse-Users:

  • Try to use the AUTOCRLF conversion
  • AUTOCRLF should be default with all users!
  • If you have some files which should not use AUTOCRLF, define them as exception within a .gitattributes file. Checkin the .gitattributes file with your repository.

Doing so, git converts the files automagically the file to the "correct" linenending, depending on the OS you are. The .gitattributes keeps the exceptions from this rule with the format defined in .gitattributes and as .gitattributes is part of the repository, those files will be handled equally on each checkout - indenpendent from current OS.

0 votes
Claudio Kirchhoff November 27, 2016

Hi Gerado,

honestly, I wouldn't know why changes made by your colleagues - intentional or not - should result in unstaged files on your machine. What do you know about those files: are they under version control at all? Could those be generated files or are they definitely source files?

If they are source files, then I don't know what's going on. I f they are generated, however, you should probably ignore them.

Cheers

Claudio

Johannes Kilian
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.
November 27, 2016

It's a common problem for git beginners/users to run in problems with "lot of modified files after pull/clone" - see for example: http://stackoverflow.com/questions/5009096/files-showing-as-modified-directly-after-git-clone. Most common reason is line endings setting ...

Claudio Kirchhoff November 29, 2016

Wow, I knew about the line endings issue, but I wasn't aware it could manifest itself that way!

0 votes
Sam Hall
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.
November 27, 2016
Johannes Kilian
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.
November 27, 2016

I don't think ignoring is the way to go. What if someone else changes an file, I ignore? I'm gonna miss the change - and that isn't very helpful ...

Sam Hall
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.
November 27, 2016

Good point. Your answer is much better!

TAGS
AUG Leaders

Atlassian Community Events