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

A conceptual illustration shows a chat bubble icon at the center of a complex maze, representing the challenges of evaluating Large Language Models for commercial applications. The intricate blue-tinted labyrinth symbolizes the many considerations Cuttlesoft navigates when implementing AI solutions in enterprise software - from API integration and cost management to security compliance. This visual metaphor captures the complexity of choosing the right LLM technology for custom software development across healthcare, finance, and enterprise sectors. The centered message icon highlights Cuttlesoft's focus on practical communication AI applications while the maze's structure suggests the methodical evaluation process used to select appropriate AI tools and frameworks for client solutions.
September 12, 2024 • Frank Valcarcel

Benchmarking AI: Evaluating Large Language Models (LLMs)

Large Language Models like GPT-4 are revolutionizing AI, but their power demands rigorous assessment. How do we ensure these marvels perform as intended? Welcome to the crucial world of LLM evaluation.

Image for TWIL post depicting ActiveRecord range query examples in Ruby on Rails, enhancing database search efficiency.
September 16, 2020 • Frank Valcarcel

TWIL 2020-09-11

This week’s TWIL features Katie’s guide to using new range syntax in ActiveRecord queries, revealing how to efficiently search databases in Ruby on Rails.