2

I work with hundreds of github repos, and it's getting a little tedious to set remotes in every repository when I need to push for a PR. Is there a way to set the default account for all pushes.

For example, I've cloned a repo:

git clone git://example.com/work/repo1

When I push, I'd like the branch to go to:

git push fork branch-name

But I'd like fork to refer to git://example.com/employee/repo1 based on some global setting, so that it would "just work" as I contributed to repo2, repoG, repo0x03773H, etx.

Andrew Prock
  • 6,900
  • 6
  • 40
  • 60
  • You should be able to configure / write a "global" git client hook to add the remote on checkout. More details here https://stackoverflow.com/questions/2293498/git-commit-hooks-global-settings?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Max Friederichs Mar 27 '18 at 05:45
  • You can also write a bash script and execute that whenever you want – Skywalker Mar 27 '18 at 06:20

0 Answers0