GitHub has a cli tool that augments git with some GitHub specific operations and functionality. One of them is precisely what you're looking for. Check out hub
Automatically add remotes that do not exist based on a pattern
-
15-06-2023 - |
Question
I'm working with a large open-source project on GitHub, and will need to test lots of pull-requests by pulling down their code locally. I'd love to be able to hook into git somehow so that when I type git fetch someUser
, if there is no origin named someUser
, a new origin is added at git@github.com:someUser/repoName.git
.
Is there such a way to intercept git's operations? Is there a script out there that does this? If not it's not the end of the world, and may prompt me to look into git's insides a bit more to see if I can make it happen.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow