Git marking unchanged files as modified

Here is the main problem: git seems to mark all my files as modified, although there are no changes. Even diff does not show any difference, but he wants me to set / commit all the files again. How can I convince git that there is no change in the way that is still tracking changes made from this point?

I have a git repository that I am editing on two separate computers (both are Macs). I use them to transfer using an image of an encrypted file system on a USB drive and copy using rsync. When I transfer files to my laptop, all files are marked as modified. If I just ignore git and work on files, rsync'ing it back, another computer will correctly recognize only modified files again. Therefore, it works, but it’s really inconvenient for me to work on my laptop when I can’t make my changes until I get back to another machine, because at this point I will have to make several changes in one session.

+6
source share
2 answers

It turns out that this is not the end of lines. I doubted this decision, since I assumed that git would show each line as changed, which is not the case. But today I came across a small small entry that was in the log when I checked files on my work computer - file permissions were changed from 644 to 755 (or vice versa) when transferring between machines.

The solution is right here in stackoverflow in this question: How do I make git (chmod) ignore mode changes?

+5
source

I would check if the final lines in the transfer change. Although this can be a real problem to solve the problem, you can help control it using the core.autocrlf option, as described in this question .

I also definitely checked the GitHub help section on line termination , as it has some useful tips to solve this problem (assuming this is actually your problem).

+3
source

Source: https://habr.com/ru/post/907049/


All Articles