fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream U201814580 master To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'.
时间: 2024-02-17 18:05:09 浏览: 18
这个错误通常出现在你尝试将当前分支推送到远程仓库时,但该分支没有与远程分支建立关联。你可以使用以下命令将当前分支与远程分支关联并将其推送到远程仓库:
```
git push --set-upstream U201814580 master
```
这个命令将当前分支与名为master的远程分支关联,并将其推送到名为U201814580的远程仓库。
如果你不想每次手动设置upstream,可以使用以下命令自动设置:
```
git config --global push.default upstream
```
这个命令将自动为没有upstream的分支设置upstream。
相关问题
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'命令。