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