avatar vian's notes

Learning in public, one post at a time

  • HOME
  • CATEGORIES
  • TAGS
  • ARCHIVES
  • ABOUT
Home How I Stopped Committing as the Wrong Person
Post

How I Stopped Committing as the Wrong Person

Posted Oct 17, 2026 Updated Aug 24, 2026
By Alvian
3 min read
How I Stopped Committing as the Wrong Person
How I Stopped Committing as the Wrong Person

The Wrong Name in the Log

A few days ago my laptop broke — some keyboard keys stopped working — so the office swapped it for a spare. Re-setting up my workspace meant SSH keys, dotfiles, git config, the lot. Somewhere in that re-setup, git’s identity fell through the cracks.

The proof showed up in the log: every commit I’d made since the swap said the same thing — my new laptop’s username. Not my GitLab handle. Not my GitHub handle. Just the local account I logged into macOS with.

Nothing was broken — the commits pushed fine. But it didn’t look clean, and in any shared repo, the author field is the artifact you leave behind. I keep two identities: a GitLab work account (alvian.r.hanif / alvian.hanif@pasarpolis.com) and a GitHub account (vianhanif / alvian524@gmail.com). I’d never had to think about this before — the swap forced me to rebuild my setup, and it made the problem visible.

The stakes were simple: I didn’t want work commits carrying the wrong identity, and I didn’t want to scrub git history later — rewriting history is a one-way door. I wanted to make the mistake impossible, not just less likely.

Routing by Directory

My projects already lived in two groups — ~/Documents/work/ and ~/Documents/personal/ — and I could split each further by host: gitlab, github. So instead of configuring git per repository, I configured it per directory using conditional includes in my global ~/.gitconfig.

I created two identity files, one per account:

1
2
3
4
# ~/.gitconfig-gitlab
[user]
    name = alvian.r.hanif
    email = alvian.hanif@pasarpolis.com
1
2
3
4
# ~/.gitconfig-github
[user]
    name = vianhanif
    email = alvian524@gmail.com

Then I wired them into the main config:

1
2
3
4
5
6
7
8
[includeIf "gitdir:~/Documents/work/gitlab/"]
    path = ~/.gitconfig-gitlab

[includeIf "gitdir:~/Documents/work/github/"]
    path = ~/.gitconfig-github

[includeIf "gitdir:~/Documents/personal/github/"]
    path = ~/.gitconfig-github

Three directories, two files — my GitHub identity is mine everywhere; the axis that actually mattered was GitLab vs GitHub. Any repo living under one of these trees picks up the matching identity when git looks up its config.

One caveat worth knowing: a per-repo user.name or user.email in a repo’s own .git/config overrides these includes. So the migration had a second half — making sure none of my repos carried a stale local identity. git config user.email shows the effective value; add --show-origin to see where it comes from. (A stricter option: git config --global user.useConfigOnly true, which makes git refuse to guess an identity when none is configured.)

The Migration

I had 13 repositories to sort. I classified each one by its remote (git remote get-url origin):

  • Work (GitLab): five repos
  • Work (GitHub): five repos
  • Personal (GitHub): three repos

I proved the routing first: a throwaway repo in each of the three folders, git config user.email, the right account, delete. Then I moved the real repos into their folders and confirmed each one resolved the same way.

Outcome: Config by Location

Now every repo I clone into those folders inherits the correct identity automatically. No per-repo config, no pre-push ritual. The fix took an afternoon — and it’s the kind of thing I wish I’d done sooner. The visible result is a git history where every commit says what I actually meant it to say.


Sources

  • Git Documentation: Conditional Includes
personal technical
This post is licensed under CC BY-NC 4.0 by the author.
Share

Recently Updated

  • Headroom, Round Two: Four Walls Between Me and a Working Token Saver
  • The Server Split That Almost Didn't Happen
  • I Opened My First Open Source PRs. None of Them Are Merged Yet.
  • Checking Upstream: What v0.5.50 Gained for 9router
  • The 403 That Wasn't: How Warp, 9router, and Cloudflare Masked Two Separate Failures

Trending Tags

9router technical tooling ade ai personal postmortem warp agents orchestration

Contents

Further Reading

Oct 7, 2026

Part 1: Why I Need Analytics for My Personal Blog

I spent my first few months of blogging writing into the void. Hit publish, share the link, and wait—for nothing. No comments, no emails, no signal that anyone had seen the words. It felt like shou...

Aug 30, 2026

CC BY-NC 4.0: The License I Chose for This Blog

You know that little badge at the bottom of every post? The one that says a Creative Commons license and links somewhere? I didn’t put it there. It came with the theme. I’m using Chirpy, a Jekyll...

Jul 8, 2026

This Is My ADE

I hit send on a prompt. Watched the spinner. Started calculating — was I past the cap yet? Three weeks into the billing cycle, OpenCode Go had hit its limit. I’d been conditioned to expect the erro...

© 2026 Alvian. Some rights reserved.

This blog is open source — view on GitHub

Using the Chirpy theme for Jekyll.

Trending Tags

9router technical tooling ade ai personal postmortem warp agents orchestration