📌

Create a local branch that tracks a remote branch

2022/06/10に公開

description

git fetch remoteName
git switch -c localBranchName -t remoteName/remoteBranchName

git switch -t, --track
When creating a new branch, set up "upstream" configuration.

example

For example, when cloning a remote repository.

git fetch origin
git switch -c dev -t origin/dev

Discussion