When working with Git on the command line, I spend a lot of time switching back and forth between two branches. Even with Git tab completion, it is a lot of typing. However Git has a shortcut for the previous branch, a single dash (-).
I was working on one Git branch and I wanted a file from another branch. Using git checkout, we can do this.
A quick table of the differences in 301, 302, 303, and 307 Redirects.
I’ve written about using “git push –force-with-lease” instead of git push –force” because “force-with-lease” will only force push changes if your local copy is aware of all of the commits on the remote branch but how is git “aware” of the commits.
On a project I needed to redirect a URL based on the presence or absence of a URL parameter. This is the htaccess rule I added.
Never use git push –force. Seriously, don’t use it. You should always use –force-with-lease instead. We’ll look at the problem with –force and how –force-with-lease addresses the issue.
The PDF Toolbar that comes up in Google Chrome when displaying a PDF can be suppressed by modifying the URL.
Both HEAD^ and HEAD~ can be used in Git to refer to previous commits but in different ways.
By default Vim is the editor used when writing a Git commit message. While I love Vim, it does work very differently than most other editors. A good option for those who are not comfortable with Vim, is to use a different editor. This is how to setup Git to use a different editor.