20 Posts Tagged ‘git’

(All tags.)


Git: How to skip hooks

Skippity skippity skip!

Git hooks are useful for enforcing standards in your repositories. But sometimes, they’re in the way and you gotta skip ’em (locally), such as when writing “WIP” commits, experiments, and even testing hooks. Here are a few techniques for skipping hooks.

Read more...

Git: How to add and remove execute permissions

Careful management of permissions on Windows.

POSIX permissions include the execute permission, which allows the file to be executed as a program. The permission can be set for each of the three classes: user, group, and others. So, for example, you can have a file that is executable only by its owning user.

Read more...

Git: How to change the case of filenames

Dang, didn’t realize capslock was on!

Different filesystems have different case sensitivity, for example:

Read more...

Git: How to disable status advice

Unwanted advice is annoying, no matter how it’s dressed up (generated by Stable Diffusion)

Many Git commands output “advice”, with hints about which commands you could run next. Most notably, git status gives you advice for what to do about files in each state:

Read more...

Git: An alias to speed up fixing merge conflicts

Fixing merge conflicts can feel like untangling knots…

There you are, minding your own business, rebasing your branch and… surprise! A merge conflict!

Read more...

pre-commit: How to run hooks during a rebase

Let’s make your rebases soar!

pre-commit uses Git’s hook system to run tools when you commit. Unfortunately, Git doesn’t run any hooks when making a commit during a rebase. This can lead to you rebasing a branch and not realizing some code needs fixing, at least not until your CI system runs pre-commit (say, with pre-commit.ci).

Read more...

Git: How to set up a global ignore file

A whole stack of papers to ignore (generated by Stable Diffusion)

Have you ever accidentally committed a bunch of junk created by your OS, like Thumbs.db files from Windows, or .DS_Store files from macOS? Or, have you joined a project, and for one of your first commits, added rules to the .gitignore file for your text editor’s project files? If so, this post is for you! You can avoid such pain or busywork by making a global ignore file.

Read more...

Git: How to automatically stash while rebasing or merging

A veritable stash of almonds (generated by Stable Diffusion)

Imagine you’re part way through making some changes, and you realize that you need to rebase or merge. You can:

Read more...

Git: How to undo commits

Just press here to undo!

To errr is human, to undo computer can help.

Read more...

Git: How to automatically create upstream branches

That’s a serious number of branches.

You started a new feature branch, worked hard on initial commits, and you’re ready to send it for review. You try to push and:

Read more...