Lichendust

I'm Harley, an artist, animator and programmer.
I make all kinds of useless stuff.

Git

🌱
🌿
CONTENTS

These notes cover both using Git on the command line and in my preferred GUI interface, Sublime Merge.

Configuration

Username without Email

This isn't recommended, especially if you're expecting to push to a host like sr.ht where you need a functional email to collaborate.

git config --global user.name 'Snail Mail'
git config --global user.email '<>'

Operations

Return to a commit in history

Checks out a historical commit in a way that allows you to simply commit the reverted files again and continue the branch. No deleted history, no individually un-writing commits, no weird branch nonsense, just 'whoops go back' and continue as if nothing happened.

git revert --no-commit <commit_hash>..HEAD

Clone a specific tag

git clone --branch tag http://website.net/git/abc

I use this for checking out things I'm going to compile and immediately delete all the time.

Rebase a branch without losing your mind

In pure Git commands, this is actually fairly simple —

git checkout <branch>
git rebase <target>
  1. In Sublime Merge, check out the branch you want to rebase.
  2. Right click on the commit from the target branch you want to rebase onto.
  3. Select rebase.

It feels like these options should be elsewhere, under all the branch control dropdowns and such, but they're not. They're also not under the context menus for the current branch's commits either.

Change a remote URL

This can't be done in Sublime Merge, but is fairly simple in practice —

git remote set-url <name> <url>
WORD COUNT
271
LAST UPDATED
2025-12-27