Git with Multiple Email Addresses
paedubucher.ch
paedubucher.ch
This allows having everything just under ~/Projects and having special configs without too much hassle IMO, it seems cleaner than using branching configs. You can still symlink the shared bits.
To work you just `su $WORK/SCHOOL_USER` to get a simple shell, use ssh+tmux to get a session, and can use editors/browsers/etc configured specifically for that user (purpose). In case you want more uniformity when editing you can use tramp (or something similar).
git clone -c "core.sshCommand=ssh -i ~/.ssh/bitbucket-work -F /dev/null" git@bitbucket.com:example/example
For existing repo:
git config core.sshCommand "ssh -i ~/.ssh/bitbucket-work -F /dev/null"
Where "bitbucket-work" is the name of the key for that particular repo.
This is in the context of go modules but it works with regular git stuff.
$ git clone git@workspace.bitbucket.org:workspace/repo.git
I haven't tried with GitHub as I only have one account I use there.
I'm not near my laptop, but it's two lines of code in the SSH config files and that's it.
Does anyone follow a similar pattern?
Host foo.bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/foo_id
As in, for using bitbucket.org with the private key ~/.ssh/foo_id, you'd instead clone from foo.bitbucket.org:owner/repo.