1

I make clone of a git repository, and right after it I get untracked and unstaged (modified/deleted) files in git status. Then I set fileMode=false for Mac, and several files go away from unstaged. But I cannot understand what to do with the others. I've tried a bunch of things from stackoverflow and other places, but nothing helps.

So my question is why I get all these untracked / unstaged files right after cloning the repo, and how to fix it. I use Mac for development, but I've tried to clone repo in Windows to see if it's the same or not. It's even funnier: it says some unstaged files deleted.

After different modifications of git config, the command git config -l looks like this:

Mac:

filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
user.email=...hidden...
user.name=...hidden...
core.autocrlf=true
core.precomposeunicode=true
core.filemode=false
core.trustctime=false
alias.gr=log --graph --full-history --all --color --decorate
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=https://bitbucket.org/...hidden...
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.demo.remote=origin
branch.demo.merge=refs/heads/demo

Win:

core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://bitbucket.org/...hidden...
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.demo.remote=origin
branch.demo.merge=refs/heads/demo

My git status looks like this:

Mac:

enter image description here

Win:

enter image description here

How can it be solved?

Martin
  • 337
  • 2
  • 17
  • So you connect to a repo with two computers: a Mac and a Win? Your question is why `git status` is not the same for both when you clone the same way from both PC? – Christoph Aug 12 '16 at 15:40
  • My question is why I get all these untracked / unstaged files right after cloning the repo, and how to fix it. I use Mac for development, but I've tried to clone repo in Windows to see if it's the same or not. It's even funnier: it says some unstaged files deleted. – Martin Aug 12 '16 at 18:17
  • Does [that](http://stackoverflow.com/questions/5009096/files-showing-as-modified-directly-after-git-clone) help? Is there any reason why you don't restrict the question to Win OR Mac (I think they both show more or less the same problem if you solve one, the other might be solved, too)? Suggestion: Make clear what you have tried that is try to make the question as short as possible. IMHO the config files won't help, but I might be wrong. – Christoph Aug 12 '16 at 21:02
  • I've seen this post, there was 2 answers that helped, one with filemode and another with lowercase twins. But untracked files remain. The reason why I don't restrict question to Win or Mac - is because I don't understand what's happening, and maybe someone who has Windows will answer this question and it will help me on Mac too. Plus, I've seen many posts about filesystem difference in cases like this, so I decided to try 2 of them at least. But I still don't understand the problem. There are non-latin unicode(?) characters in the filename, but what should I do to make git understand it right? – Martin Aug 13 '16 at 06:58

1 Answers1

1

OK, after some time of working on the problem I've found 2 solutions in this post (which is also mentioned by Christoph), it was filemode=false and lowercase twins. But untracked files remained. Then I understood that these untracked files have UTF8 characters in their filenames, and somewhere these characters were misunderstood by filesystem and/or git. I looked at these files and found that they are not actual anymore, so I just deleted them and commited this deletion.

Community
  • 1
  • 1
Martin
  • 337
  • 2
  • 17
  • Yes. I'm happy to finally see this message "nothing to commit, working directory clean" :-) – Martin Aug 13 '16 at 11:41