git checkout -t <remote>/<branchname>
Create and switch to a new branch tracking a remote branch
This command creates a new local branch and sets it to track the specified remote branch. It then switches to the new branch, allowing you to start working on it immediately.
If you omit the -t
flag, the new branch will not be set to track the remote branch. -t
is a shortcut for the --track
flag.
There is also a --no-track
flag to ensure the remote branch is not tracked even if the branch.autoSetupMerge
configuration variable is true
.
Related
git checkout -b <branchname>
git checkout -b <branchname1> <remote>/<branchname2>
git checkout <branchname>
git checkout -
git checkout --<pathname>
git checkout HEAD <pathname>
git checkout --ours <pathname>
git checkout --theirs <pathname>
git checkout -m <branchname>
git checkout --orphan <branchname>
git checkout -b <branchname> <commit>