Git – How to configure git to avoid accidental git push


After git clone, the config in the new repo looks like:

remote.origin.url=<some url>

Then, I can execute "git pull" and "git push". But I'm interested in only do "git pull", because I want to push into another repo.

One thing I can do is:

git add remote repo-for-push <some other url>
git push repo-for-push master

But I would like to configure git to use default and distinct repositories for pull and push, i.e:

git pull # pulls from origin
git push # pushes into repo-for-push, avoiding accidental push into the origin

How can this be configured?
Thanks in advance.

Basically, I want to setup the default push repo to be different from the default fetch/pull repo.

Best Solution

Looks like

git config remote.origin.receivepack /bin/false

Makes push to remote origin fail.