fatal: The current branch TqxBranch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin TqxBranch To have this happen automatically for branches without a tracking upstream, see 'push
时间: 2024-01-09 20:04:21 浏览: 30
.default' in 'git help config'.
这个错误通常是因为你在当前分支上没有设置 upstream 分支,即没有指定当前分支所对应的远程分支。你可以使用以下命令来将当前分支与远程分支建立关联:
```
git push --set-upstream origin TqxBranch
```
执行该命令后,你就可以使用 `git push` 命令来推送当前分支的修改到远程分支了。如果你希望 Git 在推送分支时自动关联远程分支,可以设置 `push.default` 配置项。例如,你可以执行以下命令:
```
git config --global push.default simple
```
这样,当你使用 `git push` 命令推送当前分支时,Git 将会自动将当前分支与远程分支关联起来。
相关问题
fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream,
you can use the following command:
```
git push --set-upstream origin master
```
This command will push your current branch (master) and set the remote branch (origin/master) as the upstream branch.
fatal: the current branch main has no upstream branch. to push the current branch and set the remote as upstream, use git push --set-upstream origin main
这是Git命令行给出的一则警告消息,意思是没有与当前分支(main)关联的上游分支。如果想要推送当前分支并设置远程分支为上游分支,应该使用'git push --set-upstream origin main'命令。