Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project commits too many files

I just cloned a project using git and opened a new branch. After changing just 1 file I tried to commit the changes but it shows me that I am commiting like 3000+ files. After clicking on any file to see the differences, the phpstorm says "no differences".

I heard that might be an error related to line endings but I have no idea what to do actually right now. Could you please help me? It is impossible to verify 3000 files right now, and I dont want to destroy the project by pushing something crazy.

I tried changing line endings in phpstorm to LF (unix) and CRLF (windows) but it doesnt help at all. I heard it might be necessary to also change it in git, so I tried to run some random recommended commands but no results at all.

EDIT: added 100 reputation bounty. I cannot resolve this problem

SOLUTION: Okay, looks like it was privilege issue. I gave chmod 777 on all directories and it was too much.

like image 679
divHelper11 Avatar asked Dec 05 '16 14:12

divHelper11


People also ask

How do I remove multiple commits?

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

Is there limit to the number of commits on github?

We don't have a limit on the number of commits per repository.

Should I commit each file separately?

If you're adding multiple features all in the same file, keep them as separate commits. I would worry less about the number of files that you're affecting with the commit and more about the overall functionality/idea of the code. Save this answer.


1 Answers

Check the nature of the diff.

For eol, try:

git -c color.diff.whitespace="red reverse" diff -R -- afile

If that is the case, clone again your repo after a

git config --global core.autocrlf false

Check also for any text=auto directive in a .gitattributes file.


For file permission mode, clone again your repo after:

git config --global core.filemode false

You can see the difference with git diff, as I mentioned in this answer.
Note that since Git 2.9.1, you can change the permission of a file with

git add --chmod=+x -- yourFile
like image 111
VonC Avatar answered Sep 24 '22 01:09

VonC