Organizing Multiple Git Identities

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • lazydocker

    The lazier way to manage everything docker

  • I use podman containers with lazydocker. https://github.com/jesseduffield/lazydocker That way my work is a bit more separated. Good tips.

  • git-switch-user

    Manage your git identities with ease

  • Shameless plug of a tool I wrote for managing multiple git identities:

    https://github.com/cquintana92/git-switch-user

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • starship

    ☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!

  • I use conditional includes for this, but I also add a single letter describing which Git identity I'm currently using to my PS1 so that it appears before $ in my shell prompt. This prevents me from committing code with the wrong identity, in case I'm using a git checkout that's anywhere not covered by the conditional include rules.

    I use Starship (https://starship.rs) to manage my prompt, and wrote a short script that only runs if I'm somewhere in a git repo, and if so finds my Git user's email and looks up the corresponding letter in an associative array declared in my ~/.config/starship-zsh/.zshenv:

        git_email=$(git config --get user.email | perl -pe 'chomp if eof')

  • github-keygen

    Easy creation of secure SSH configuration for your GitHub account(s)

  • https://github.com/dolmen/github-keygen

    The project might not look active, but that's because it just works. 12 years old now.

  • gitprof

    CLI tool which simplifies working with multiple Git accounts/services.

  • I developed a program to help with this — it's called "gitprof", since it helps with Git profiles.

    https://github.com/CabbageDevelopment/gitprof

  • github

    Discontinued Just a place to track issues and feature requests that I have for github

  • Probably the older email address is still the primary one for the GitHub account.

    GitHub took it upon themselves to change email addresses and author names when merging via the UI buttons like "Squash and Merge" in 2018 and then again in 2019. See <https://github.com/isaacs/github/issues/1368> for the tedious details.

    Essentially the post-2019 behaviour seems to be that where possible with "Squash and Merge" they will set noreply@github as the committer so that they can sign the merged commit themselves, and set author name & email to what they have recorded for the GH account involved (and the signature is then a record that GH have verified that account's involvement).

    Personally I think it is shocking that they ignore the name and email address that the actual author of the commit has selected. This is both a violation of the author's intentions -- for example, you may set work and personal email addresses in different repositories as discussed here, but GitHub will rewrite them all to the same thing when other people press "Squash and Merge" on your pull requests -- and potentially a doxxing security risk.

    I have considered re-reporting this to GitHub via the newer community discussions or via support again, but given the extent to which they've ignored all such reports over the last five years it is hard to find the motivation to do so.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts