magicmonty / bash-git-prompt

An informative and fancy bash prompt for Git users
BSD 2-Clause "Simplified" License
6.7k stars 962 forks source link

Managing git profiles #473

Open fenfir opened 3 years ago

fenfir commented 3 years ago

I made a tool for managing different git profiles since I use a couple of different github accounts. Is this something that I could create to create a PR for?

https://github.com/fenfir/git_profile

laur89 commented 3 years ago

Isn't that something that should be managed by local git config?

fenfir commented 3 years ago

All of the ways that I have found to use it involve manipulating your ssh config and using fake hostnames github-profile2 for system wide configuration. Which breaks some projects. I'm specifically having issues with go since it pulls most of it's dependencies from github.

This script is a wrapper around git config, but I find it useful to be able to switch accounts with a single command on a global level so I don't need to modify my git configs when I need to switch profiles for a different client.

fenfir commented 3 years ago

Plus the ability to have it visible in my prompt so I know which user I'm pulling and committing code with.

fenfir commented 3 years ago

I also don't think the management necessarily belongs in this repo, but displaying it in the prompt could.