User Tools

Site Tools


git_establishing_tracking_branches

Overview

Various ways to establish tracking branches. Use linux-next remote ln with branches:

  • master
  • akpm
  • akpm-base
  • pending-fixes
  • stable
$ git fetch ln
$ git branch -a
* master
  remotes/ln/akpm
  remotes/ln/akpm-base
  remotes/ln/master
  remotes/ln/pending-fixes
  remotes/ln/stable
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
$

Track upstream branch from EXISTING branch

$ git branch [-u|--set-upstream-to=] <origin/remote> [localname]

Create the branch to be set to track:

$ git checkout -b rday

Examples while on branch rday:

$ git branch -u ln/akpm
$ git branch -u ln/akpm myakpm
$ git branch --set-upstream-to=ln/akpm
$ git branch --set-upstream-to=ln/akpm myakpm

Establish new tracking branch

$ git checkout ln/akpm             [detached head]
$ 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/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow
...

Unset tracking branches

$ git branch --unset-upstream
git_establishing_tracking_branches.txt · Last modified: 2019/04/04 01:53 by rpjday