When I run git remote -v in one of my Git repositories that has a remote(s) configured, I see that each remote has both fetch and push specs:
$ git remote -v
<remote-name> ssh://host/path/to/repo (fetch)
<remote-name> ssh://host/path/to/repo (push)
For remotes that point to peer developers there’s no need to push, and Git will refuse to push to a non-bare repository anyway. Is there any way to configure these remotes as “fetch-only” with no push address or capabilities?
I don’t think you can remove the push URL, you can only override it to be something other than the pull URL. So I think the closest you’ll get is something like this:
You are setting the push URL to
no-pushing, which, as long as you don’t have a folder of the same name in your working directory, git will not be able to locate. You are essentially forcing git to use a location that does not exist.