#git

Tips and tricks for working with Git

Understanding .gitignore with `git check-ignore`

Another day, another obscure yet very useful git command! This time, it’s git check-ignore which helps us to understand why a file is being ignored, or why it’s not if you expect it to be.

Show untracked files with `git status`

When working with new folders, git does not show the contents of those folders by default when you run git status.

A better `git blame` with `--ignore-rev`

One of the biggest arguments against running automatic formatters against a codebase is that we lose the benefits that git blame gives us.

Retag a Git Tag

The convention when building GitHub Actions is that you have a v1 tag that alway points at the latest release in the v1.x.x series. In most cases I'm using build-and-tag-action to handle this but in …

Restore a file without adding to the index using Git

After fetching a list of deleted files with --git-diff-filter I wanted to restore the files to my current working directory.

Show all files deleted since Git commit

Whilst working on my TIL page I cleared out a few old blog posts that fit in to the TIL category but weren’t really relevant any more.