diff --git a/guide/english/git/git-branch/index.md b/guide/english/git/git-branch/index.md index bb431ace14..2a0b3bbb77 100644 --- a/guide/english/git/git-branch/index.md +++ b/guide/english/git/git-branch/index.md @@ -15,6 +15,7 @@ Git's branching functionality lets you create new branches of a project to test - [Compare Branches](#compare-branches) - [Help with Git Branch](#help-with-git-branch) - [More Information](#more-information) +- [Track a Remote Branch](#track-a-remote-branch) ### View Branches To view the branches in a Git repository, run the command: @@ -101,6 +102,16 @@ You'll see colored output for the changes between branches. For all lines that h If you want to see a list of all the branches that are completely merged into your current branch (in other words, your current branch includes all the changes of the other branches that are listed), run the command `git branch --merged`. +### Track a Remote Branch +If you already have a branch and you want to track a remote branch, then you use `set-upstream-to` command: +```shell +git branch --set-upstream-to origin/BRANCH +``` +Or you can use the `-u` flag (upstream) when you make your first push: +```shell +git push -u origin BRANCH +``` + ### Help with Git Branch If you forget how to use an option, or want to explore other functionality around the `git branch` command, you can run any of these commands: ```shell