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.
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.
We don't have a limit on the number of commits per repository.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With