News for hackers. Stuff that matters.
Re:Show HN: Switch Git Users CLI by augusto-moura on Thursday November 12, 2020 @12:37PM (#25072302)
Git has conditional includes based on path[1]. My configuration is like:

On ~/.gitconfig

  [user]
    name = personal
    email = [email protected]

  [includeIF "gitdir:~/workspace/"]
    path = ~/work.gitconfig

Then on ~/work.gitconfig

  [user]
    name = workname
    email = [email protected]
[1] https://git-scm.com/docs/git-config#_conditional_includes
Re:Show HN: Switch Git Users CLI by lilyball on Thursday November 12, 2020 @04:22PM (#25075234)
Just a note of caution, when this feature was added tools based on libgit2 did not understand it. I just checked now, libgit2 eventually added support (though it took 5 months since I filed the ticket). But if you're using any tools that have a 3-year-old version of libgit2 they might not understand it.
Re:Show HN: Switch Git Users CLI by grenoire on Thursday November 12, 2020 @02:57PM (#25074141)
Woah, this is neat!