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