5 Posts Tagged ‘git’

(All tags.)

How to Clean Up Unused Code With Git

Time to go digging through your project’s ancient history…

Projects often accumulate an amount of unused code. This cruft makes a prjoect harder to navigate, and can confuse future development or debugging.


How to Squash and Rebase a Git Branch

We gotta Git out of this place.

It can be tiresome to rebase feature branches with many commits. You may have several commits that conflict with your main branch. Before rebasing such branches, you may want to squash your commits together, and then rebase that single commit, so you can handle all conflicts at once. Here’s how to do that.


How to Run a Command on Many Files in Your Git Repository

Git getting you feeling crabby?

Occasionally it’s useful to run commands on files in your repository, or all files matching a pattern. This is possible by combining git ls-files and xargs.


Comparing Generated Files Before and After Changes with Git Diff

The trilobite lived very much before

Once in a while, I have to make a change to many or all of my blog posts. For example, implementing opengraph meta tags.


A Git Check for Missing Commits From a Remote

Branching Game

I recently add a pre-flight check to a devops project to ensure that all commits from the Git repository’s origin/master are present locally. This is to guard against developers accidentally reverting others’ deployed changes.