Relative Content

Tag Archive for gitgit-config

Using multiple github accounts on one computer with the gh cli auth

I would like to be able to use 2 or more github accounts on one computer without the need to change the url or switching accounts in the gh cli. This should be for all git commands including the clone. I’d be happy to use multiple .git_config files and link them by directory or by remote url.

Is there a way to simplify automatically storing a git config when cloning a repository?

In How to store a git config as part of the repository? it is laid out how to create a custom git config and include it in the path for a single repo. The one issue I have with this is that the commands they outline – git config --local include.path ../.gitconfig – seemingly need to be run every single time the repository is cloned in order to make use of the aliases within it.

How to use `git config –get-colorbool`?

I tried to use git config --get-colorbool to make my custom script emulate how normal Git commands decide when to color output.
However, unlike normal comands and contrary to what manual says, the command ignores whether stdout is TTY or not.
Additionally, it prints bools I pass to it, for some reason.

git config: more insteadOf on the same url elide each other

I’d like to have a ~/.gitconfig containing redirections of different URLs (here for sake of simplicity “aaa” and “bbb”) onto the same one (again for simplicity “1234”)
I can do this if I write the file manually, but I’ve noticed that if instead I set it via git config the 2nd setting is going to elide the previous one: