git has no tracked branch
时间: 2023-08-09 18:07:27 浏览: 66
If Git shows the message "git has no tracked branch," it means that the current branch you are on does not have an upstream branch set. An upstream branch is a branch in a remote repository that your local branch tracks.
To fix this issue, you can set an upstream branch for your current branch using the following command:
```
git branch --set-upstream-to=<remote>/<branch> <local_branch>
```
Replace `<remote>` with the name of the remote repository, `<branch>` with the name of the branch in the remote repository, and `<local_branch>` with the name of your local branch.
After setting the upstream branch, you should be able to use Git commands like `git push` and `git pull` without any issues.