0

After I cloned my repository, git status shows modified files. These are images (.png), which it's showing as modified. I've also tried with filemode & CRLF settings, nothing worked. I'm not able to add them or checkout them. I'm on Mac. Here is a screenshot of the git status result,

git status result

  • When I do same git pull or clone on ubuntu system, there are no issues. I just have to set filemode to false there.

Thanks in advance.

  • try git reset, it will undo all checkout – Sonal Borkar Nov 26 '18 at 18:51
  • Why aren't you allowed to add or checkout? What happens when you try? – Green Cloak Guy Nov 26 '18 at 18:52
  • @SonalBorkar Tried, but it's not working. It shows same files under 'Unstaged changes after reset:' and nothing else. – Abhishek Vaishnav Nov 26 '18 at 18:54
  • @GreenCloakGuy Nothing happens. I do 'git add .' and then again after 'git status' , the result is same. – Abhishek Vaishnav Nov 26 '18 at 18:55
  • Possible duplicate of [Why does 'git status' show binary file as modified when it's not and file modes are the same](https://stackoverflow.com/questions/34503622/why-does-git-status-show-binary-file-as-modified-when-its-not-and-file-modes) – enapupe Nov 26 '18 at 18:56
  • 1
    @AbhishekVaishnav Are you using Git LFS? Also, what does `git diff` show? – Bless Nov 26 '18 at 18:58
  • @AbhishekVaishnav might need hard reset try below command git reset --hard origin/master – Sonal Borkar Nov 26 '18 at 18:59
  • @Bless When I do git diff . it shows result lie this, diff --git a/application/modules/Advancedactivity/externals/feelings/celebrating/International-Women's-day.png b/application/modules/Advancedactivity/externals/feelings/celebrating/International-Women's-day.png index a6ab567562..d328e2d057 100644 Binary files a/application/modules/Advancedactivity/externals/feelings/celebrating/International-Women's-day.png and b/application/modules/Advancedactivity/externals/feelings/celebrating/International-Women's-day.png differ – Abhishek Vaishnav Nov 26 '18 at 19:02
  • @SonalBorkar Not working. It's just changing the head, but still showing the modified files. – Abhishek Vaishnav Nov 26 '18 at 19:03
  • @enapupe Yes checked that already, but didn't work out for me, i.e. git reset --hard didn't work. – Abhishek Vaishnav Nov 26 '18 at 19:05

1 Answers1

1

Try below git command in exact sequence as given below

 git fetch origin
 git reset --hard origin/master
 git clean -f
 git status
Sonal Borkar
  • 531
  • 1
  • 6
  • 12
  • Not working. When I reset --hard, it does show 'unable to unlink old' and filename for all files. I use sudo and it changes head. After clean, when I again checked status, it still shows those files' list. – Abhishek Vaishnav Nov 26 '18 at 19:23
  • 1
    ok, that means git couldn't have write permission to the folder where the file resides or the file is accessed by other processes in the system. Well, you may anytime delete the folder manually outside of git and then again do the git reset --hard and then git pull followed by git status – Sonal Borkar Nov 26 '18 at 19:30