Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_establishing_tracking_branches [2019/04/04 01:05] – rpjday | git_establishing_tracking_branches [2019/04/04 01:53] (current) – [Track upstream branch from existing branch] rpjday | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| * '' | * '' | ||
| - | ===== Start tracking an upstream branch ===== | + | < |
| + | $ git fetch ln | ||
| + | $ git branch -a | ||
| + | * master | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Track upstream | ||
| < | < | ||
| - | $ git branch [-u|--set-upstream-to=] | + | $ git branch [-u|--set-upstream-to=] |
| </ | </ | ||
| - | Examples: | + | Create the branch to be set to track: |
| + | |||
| + | < | ||
| + | $ git checkout -b rday | ||
| + | </ | ||
| + | |||
| + | Examples | ||
| < | < | ||
| Line 24: | Line 44: | ||
| </ | </ | ||
| + | ===== Establish new tracking branch ===== | ||
| + | < | ||
| + | $ git checkout ln/ | ||
| + | $ git checkout --track ln/akpm | ||
| + | $ git checkout -b myakpm ln/akpm | ||
| + | $ git checkout -b | ||
| + | </ | ||
| + | ===== Seeing tracking branches ===== | ||
| + | |||
| + | < | ||
| + | $ git branch -vv | ||
| + | ... | ||
| + | * myakpm 1eff8dddb1af [ln/akpm] drivers/ | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ===== Unset tracking branches ===== | ||
| + | |||
| + | < | ||
| + | $ git branch --unset-upstream | ||
| + | </ | ||