Git-User-Switch

Dev tools

git identity switcher

SHOW HN2020

140points
57comments
#437of 3,028 in 2020
Top 15%of 2020 by points

How HN took it

CuriousMostly questions and neutral comments

4 positive, 18 neutral or asking, 2 mixed, 10 critical, out of 34 comments about the project. Thread score -0.24.

Idea: 2 for, 4 againstExecution: 1 for, 4 againstDesign: 1 for, 1 againstPerformance: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Git conditional includes or per-repo config are simpler alternatives

    From 3 comments
    • https://git-scm.com/docs/git-config#_conditional_includes Is a lot easier then what you came up with.
      Foxboron on HN
    • This is a great looking tool. What I have been doing by hand for some time is putting code for different customers in different directories and having a conditional in…
      pavlo on HN
    • Looks neat, but I agree with others about using conditional includes instead. Perhaps this tool could build on that?
      zachrip on HN

Objections

  • Pulls in a large npm dependency tree for a small script

    From 3 comments
    • This package installed 47.4MiB of node_modules. Yikes.
      miguelmota on HN
    • A 1000 line YARN lock file for something that would be roughly 20 lines of bash is amazing and terrifying at the same time.
      Foxboron on HN
    • What's the point of writing this simple tool in js? I'd like to use it but I don't have npm everywhere (and I don't want to grab a huge tree of dependencies just for editing a…
      enriquto on HN
  • Could be written as a short shell script

    From 2 comments
    • Could've been written in a 30–40 line shell script, heh.
      Icyphox on HN
    • Let’s see the 20 lines of bash that replicate all the features of this utility. Should fit in an HN comment nicely.
      cdubzzz on HN

Requests

  • Add signingKey support

    From 1 comment
    • Without using include in gitconfig: ``` #!/usr/bin/env zsh case $1 in foo) git config user.name 'John Doe' git config user.email john@example.com git config user.signingKey…
      oefrha on HN
  • Centralized data file instead of per-project data.json

    From 1 comment
    • This line makes it not very useful, because I have to re-add accounts for each project. ``` const store = require("data-store")({ path: process.cwd() + "/data.json" }); ``` I…
      SparkyMcUnicorn on HN

Alternatives named

  • git includeIf conditional includes

    From 2 comments
    • This is a great looking tool. What I have been doing by hand for some time is putting code for different customers in different directories and having a conditional in…
      pavlo on HN
    • Git has conditional includes based on path[1]. My configuration is like: On ~/.gitconfig ``` [user] name = personal email = personal@example.com [includeIF "gitdir:~/workspace/"]…
      augusto-moura on HN
  • karn

    From 1 comment
    • I currently use [karn](https://github.com/prydonius/karn) to manage multiple `git` identities. Works pretty nice.
      mr-karan on HN
  • deepsource git profiles / git-profile

    From 2 comments
    • git has a similar feature built in: https://deepsource.io/blog/managing-different-git-profiles/
      archseer on HN
    • Have seen more than a few attempts to solve this problem. Here's my version[0] and there's many more on GitHub. Wonder if there's an opportunity to unify our efforts & get…
      KuiN on HN
  • direnv with GIT_AUTHOR_EMAIL

    From 1 comment
    • I find it much easier to use direnv and set GIT_AUTHOR_EMAIL in each of ~/work/.envrc and ~/personal/.envrc No need to reconfigure every repo this way.
      0xEFF on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/25069350)