Bash script to automatically convert git submodules to regular files

August 3, 2016

Git submodules drive me batty! They are a great idea in theory however in practical application they are a pain in the butt to work with. I have a project that has accumulated over a dozen submodules over the past couple years. Switching branches and merging anything has become excruciating. This morning was the last straw.

Reset all git submodules

June 10, 2016

Here is a quick snippet that will reset all your git submodules to their most recent commit. Handy when something has happened such as a file permissions change that unintentionally affected the submodules. git submodule foreach –recursive git reset –hard

Compare a single file between git branches

June 3, 2016

Comparing a file between two git branches is quite easy. You can do it with both diff and difftool. Straight diff git diff BRANCH_ONE BRANCH_TWO — FILE Using difftool git difftool BRANCH_ONE BRANCH_TWO — FILE

Make an empty git commit

May 11, 2016

Occassionally I have need to mark a specific moment in a git repository. Often this mark is to call out a deployment point. If everything has already been committed I will use an “empty commit” as a marker. Git makes this quite easy and in fact it is built into the commit command. Run the

Autocomplete git branches and commands in bash

February 10, 2016

The tab completion for commands in bash is awesome, but it does not work for bash out of the box. Lucky for us it is relatively easy to get bash completion working. You will need two things, a copy of the completion script and an update to your bash profile. The completion script is available