I know that I can pull directly from a remote repository into my current branch using an URL without having to add the repository as a remote like this:
git pull git://github.com/them/repository.git theirbranch
This is quite convenient to quickly checkout pull requests.
Now what I wonder is if it is possible to do the same for pushing (assuming I have the needed repository access). I tried the following but it does not work:
git push git://github.com/them/repository.git theirbranch
I know that I could add the URL via git remote add
and then push to that named remote, but it seems overkill to create a config for a one-off push. I feel like it should possible but I simply can't figure out the right syntax and all examples always use named remotes.