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!
Community moderators have prevented the ability to post new answers.
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 ...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I could help - good luck in the future
My recommendation to "my" InHouse-Users:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow, I knew about the line endings issue, but I wasn't aware it could manifest itself that way!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Gerado,
Could you ignore them using a .gitignore file?
https://help.github.com/articles/ignoring-files/
https://answers.atlassian.com/questions/25144577/how-do-tell-source-tree-to-ignore-certain-files
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good point. Your answer is much better!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.