首页 > 技术文章 > IDEA新建项目提交到git仓库时报错:Can't Update No tracked branch configured for branch master or the branch...

xr210 2020-03-27 20:24 原文

写了一天代码,提交时报错。拉取也不行

Can't Update
No tracked branch configured for branch master or the branch doesn't exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to=origin/master master (show balloon)

  

原因:

  Git 不知道你要pull远程的哪个分支. 如果此时使用命令行,输入 git pull 可以查看详细的错误提示为: There is no tracking information for the current branch.  

解决方法:

  提交代码到新仓库时报错,解决方法:

  Alt + F12 呼出Terminal,输入以下指令:

git branch --set-upstream-to=origin/master

  

推荐阅读