Third installment of my Using Git series.
See my previous posts Using Git 2 and Using Git.
You can always see the changes made in the last commit using
git show
But, on occasions, you just want to see the list of files changed. You can do this by simply passing the --stat
flag:
git show --stat
Sometimes you’d git to not recognize the changes in the file permissions. This can happen very frequently if you’re mounting file systems across the network or a virtual machine. For a particular repository, you can locally set the fileMode
to false
like this:
git config --local core.fileMode false
or, simply
git config core.fileMode false
The commands above will change the ./git/config
file to add/edit the following line
[core]
fileMode = false
As always, you can use --global
flag instead of --local
flag to make a system wide change. The global change will add/edit ~/.gitconfig
file.
Line ending in Windows is \r\n
, which is the combination of Carriage Return (CR) of \r
and the Line Feed (LF) \n
. Line ending in Unix is only \n
. See the
Wikipedia entry on Newline for a better understanding.
When you edit a file on Windows or on a text editor that changes line endings, you will notice that git diff
shows that the entire file has changed. You might see ^M
at the end of lines when you see the output of git diff
.
When git diff
shows that the entire file had changed, you cannot see the meaningful changes you’ve made. To make git ignore the line endings, you can use the --ignore-space-at-eol
flag:
git diff --ignore-space-at-eol
This will still show the changes that don’t involve the line endings.
This post is the part of the Using Git series: