3 ms·
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 condit
by pavlo 6y ago
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 `~/.gitconfig` to determine what config applies there:
[includeIf "gitdir:~/projects-private/**"]
path = ./.gitconfig-private
[includeIf "gitdir:~/projects-client/**"]
path = ./.gitconfig-work
Then in .gitconfig-private or .gitconfig-work I have all the usual gitconfig settings that apply, for example the [user] section...
Switching to the right directory thus automatically changes the settings.
- diggan 6y agoThe CLI tool looks very great indeed and handy when you keep all the projects in the same top-level directory, or need to be able to change identity while in the same repository. However, your .gitconfig setup is (for me) way nicer as I already have things split up by GitHub organization, and now my identity can change without having to do anything at all. So thanks for sharing that, had no idea it was possible.
- geongeorgek 6y agoThanks for sharing this. This was what I was missing. Should've done proper research before building. I'd still think the cli could be useful in some situations. but I agree with others about how big this had to be because I used node.
- pavlo 6y agoI think a tool that has a similar UX as your is handy if a person don't care or want to memorise the gitconfig documentation to figure this out. Which, I think, is true even for most of the developers. I have found this one out by a coincidence myself.
- gru 6y agoThis is the approach that works very well for me. Especially since I keep my repos cloned into a directory structure inspired by "go get" using https://github.com/grdl/git-get https://github.com/grdl/git-get