When we want to have different file content in local repo (example robots.txt file on live server) than the one on github repo
git update-index –assume-unchanged filename
git ls-files -v|grep '^h'
When we want to make sure cross-platform file permission settings are not tracked as modified files by git:
Set filemode to false (filemode = false) in .git/config file. This file is not shared, so make sure to change wherever necessary (server)
When line ending cross-platform differences are causing git to modify files (Warning: LF will be converted to CRLF or vice-versa):
We can change config settings on each repo, or better yet, using shared .gitattributes file
More info here https://help.github.com/articles/dealing-with-line-endings/
Sample .gitattributes file when we want to force LF line endings here: https://gist.github.com/dpalomar/ebc64d6f56cfc25a3e5c20fe7cdfbd4f