set as tracked branch
时间: 2023-09-27 18:04:04 浏览: 160
track-branch:用于跟踪 git 远程分支的简单脚本
To set a branch as a tracked branch in Git, you can use the following command:
```
git branch --set-upstream-to=<remote>/<branch>
```
Replace `<remote>` with the name of the remote repository (e.g., origin) and `<branch>` with the name of the branch you want to track.
For example, if you want to track the branch "main" from the remote repository "origin", you would use:
```
git branch --set-upstream-to=origin/main
```
After running this command, Git will set the specified branch as the upstream branch for your current local branch. This means that when you push or pull changes, Git will know which remote branch to update.
阅读全文