0

I have two remotes origin and fork. What I want to achieve is to make git pull pull from origin and make git push push to fork.

  1. One approach is set different URLs for pull and push in .git/config. url is for pull. pushurl is for push. https://stackoverflow.com/a/7420741/431698 mentions this method.
  2. The other is to use git remote set-url to set url and git remote set-url --push to set pushurl. This approach basically does the same thing as method 1. https://stackoverflow.com/a/15903520/431698 mentions this method.
  3. Use remote.pushdefault. https://stackoverflow.com/a/18562564/431698 mentions this method.

Is there any method to achieve my goal?

Community
  • 1
  • 1
Jingguo Yao
  • 7,320
  • 6
  • 50
  • 63

0 Answers0