Line endings in git

Git tries to help translate line endings between operating systems with different standards. This gets sooo frustrating. Here’s what I always want: On Windows: git config –global core.autocrlf inputThis says, “If I commit a file with the wrong line endings, fix it before other people notice.” Otherwise, leave it alone. On Linux, Mac, etc: git …

Read moreLine endings in git

git: handy alias to find the repository root

To quickly move to the root of the current git repository, I set up this alias: git config –global alias.home ‘rev-parse –show-toplevel’ Now,  git home prints the full path to the root directory of the current project. To go there, type (Mac/Linux only) cd `git home` Notice the backticks. They’re not single quotes. This executes the command and then uses …

Read moregit: handy alias to find the repository root

git: I want my stash back

TL;DR – it’s a good idea to throw experimental changes on a branch instead of stashing them. Today I stashed some changes, then popped them out, then decided they were a failure and wiped them out, then (later) wanted them back. git stash makes a commit, and commits are not deleted for thirty days, so …

Read moregit: I want my stash back