Posts

Showing posts from March, 2015

Preserving History When Renaming Files in git by Scott Nelson of This by Them

Preserving History When Renaming Files in git by Scott Nelson of This by Them

REMEMBER, GIT TRACKS CONTENT, NOT FILES Git doesn’t really care that we renamed the file, but it knows that we moved the contents of the file to another file. When we tell git to show us the history for a particular file name, it will only show us the history for that file, not the entire history for the content within the file. In order to see the entire history for that content, we need to tell git that’s specifically what we want. There’s a --follow option we can pass to git logfor this.
So, to see our commits before the rename, we can do git log --follow just-an-everage-blog-post.md and voila, there’s our entire history for the content of that file.

Autocrlf setting in Git

Excerpted from: http://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf/20653073#20653073  How autocrlf works: core.autocrlf=true: core.autocrlf=input: core.autocrlf=false: repo repo repo / \ / \ / \ crlf->lf lf->crlf crlf->lf \ / \ / \ / \ / \ Reminder: crlf = win-style end-of-line marker, lf = unix-style. Note that cr (mac-style) in not affected for any of three options above. When does this warning show up (under Windows)     - autocrlf = true if you have unix-style lf in one of your files (= RARELY),
    - autocrlf = input if you have win-style crlf in one of your files (= almost ALWAYS),
    - autocrlf = false - NEVER! What does this warning mean The warning "LF will be replaced by CRLF" says that you (having autocrlf=true) will lose your unix-style LF a…