RStudio git pull button configuration

The best way is to use Git in the command line. There, you can change the upstream repo for a branch. For example, if you want to switch the upstream repo to be myupstream for the current branch:

git branch --set-upstream-to=myupstream

If you want to change the upstream for all of your branches, you can either change the URL for origin or change the upstream repo for every branch.

Setting the URL for origin:

git remote set-url https://website.com/myupstream

Changing the upstream for every branch (I'm sure there's a better way to do this, but it works for me):

for bname in $( git branch --list --format '%(refname:lstrip=2)' ); do
  git fetch myupstream $bname;
  git branch --set-upstream-to=myupstream/$bname $bname;
done