Katie demonstrating Git alias configuration on a computer screen, promoting efficient and inclusive Source Control Management practices.

Welcome to another enlightening edition of TWIL, the series dedicated to fostering continuous learning in the ever-evolving landscape of software development. This week, join Katie as she navigates the trail of Git aliases with default branch complexities. Her insights dive into creating adaptable Git aliases amidst the shifts from "master" to more inclusive terms like "main" or "primary," streamlining your Git workflow with precision and inclusivity. Save time and prevent hiccups by harnessing her tips to refine your Source Control Management practices, ensuring your Git experience stays ahead of the curve.

Git aliases with default branch

Git aliases that assume that your default branch is called "master" can be problematic (for example; having "develop" as the default branch, or the industry shift to "main", "primary". etc., etc.)

default = "!f() { git remote show ${1:-'origin'} | grep 'HEAD branch' | sed 's/.*: //'; }; f"

Some other aliases that build off of this one that I've found helpful:

cd = "!f() { git checkout $(git default); }; f"

rd = "!f() { git rebase $(git default); }; f"

up = "!f() { git remote update origin && git pull origin ${1:-$(git default)}; }; f"

update = "!f() { git cd && git up && git co - && git rd; }; f"
  • git
Katie Linero's profile picture
Katie Linero

Senior Software Engineer

Related Posts

Illustration of a small, determined knight in weathered medieval armor and a bucket helmet, wearing a tattered red cape, striding across barren cracked earth with sword drawn, surrounded by a swirling cloud of scattered wooden alphabet letters representing Token Guard, a GitHub Action that monitors and guards against token context bloat in AI coding agent workflows by counting the tokens in LLM instruction files committed to repositories."
February 10, 2026 • Frank Valcarcel

Token Guard: Keeping Your Agent Context Lean in CI

Token Guard is a GitHub Action that counts tokens in your agent context files and enforces limits in CI. Here’s why we check agent context into our repos, and why keeping it lean matters for team collaboration.

MCP (Model Context Protocol) logo — a stylized white interlinked letter mark — centered on an abstract background of flowing purple and orange gradient waves, representing AI connectivity and data integration.
November 25, 2025 • Frank Valcarcel

Anthropic’s Model Context Protocol: The Standard for AI Tool Integration

A year after launch, Anthropic’s Model Context Protocol has become the universal standard for connecting AI agents to enterprise tools. Backed by OpenAI, Google, Microsoft, and the Linux Foundation. Here’s what developers need to know.

Let's work together

Tell us about your project and how Cuttlesoft can help. Schedule a consultation with one of our experts today.

Contact Us