Let\'s assume there is a repository someone/foobar
on GitHub, which I forked to me/foobar
.
How do I pull new commits from
I don't know how it can be done without adding another remote, however I always add the repo I forked from as the upstream
remote so I could simply do:
git branch -a|grep remotes/upstream| while IFS="/" read p r b; do echo Syncing $r/$b to origin/$b; git push origin $r/$b:refs/heads/$b; done
This will sync all branches incl. creating new ones (remove the refs/heads/
to only update existing branches). If any of your branches has diverged it will throw an error for that branch.