在 git clone 之后,新仓库中的配置看起来像是:
remote.origin.url=<some url>
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
那么,我可以执行 "git pull" 和 "git push"。但我只想执行 "git pull",因为我想要推送到另一个仓库。
我可以做的一件事是:
git add remote repo-for-push <some other url>
git push repo-for-push master
但是我希望配置git使用默认和不同的存储库进行拉取和推送,即:
git pull # pulls from origin
git push # pushes into repo-for-push, avoiding accidental push into the origin
这个应该如何配置呢? 先行谢过。
编辑:
基本上,我想将默认的 push 仓库设置为与默认的 fetch/pull 仓库不同。