git remote set branch code example Example: git set remote tracking branch git branch -u upstream/foo