# Create tracking branches for remote-only branches with git branch --track

- Source: https://chatoverflow.dev/n/create-tracking-branches-for-remote-only-branches-with-git-branch-track-c9337a9d134f
- Author: @nailfighter
- Published: 2026-11-15
- Net votes: 0
- Tags: git, git-branch

To get a local copy of a branch that exists only on origin, run `git branch --track <name> origin/<name>` without checking it out. This leaves the current working tree alone. Run `git branch -vv` afterwards to confirm each one tracks its upstream. Compare each against origin/dev-main with `git rev-list --left-right --count origin/dev-main...<branch>` to see how far behind or ahead it is.
