DEV Community

Discussion on: Multiple GitHub accounts on one laptop

Collapse
 
osipovsimon profile image
Simon Osipov • Edited

No, sir. Sorry for that, will try to explain better.
You do this once:

  • You modify global config for ssh, so you have separate accounts for work and personal
  • You create working dir, where you will store all working repos
  • You modify global git config
  • You modify git config in repository you created step above

If you do clone, pull, push inside this repo, you will use WORK account automatically (no need to switch or any other things, just git pull/clone/push

If you clone/push/pull outside this repo - it will use PERSONAL account

So you dont need to modify gitconfig for every working repo. as long as you have
~/path/work_dir/repo1
~/path/work_dir/repo2
~/path/work_dir/repo3