在github中,当我尝试推送文件时,我会遇到以下提到的问题

  • 本文关键字:遇到 问题 github 文件 git github
  • 更新时间 :
  • 英文 :

The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream https://github.com/vinaykumarsp/vinaysp master
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
不幸的是,Git在这里的建议是错误的。特别是:
git push --set-upstream https://github.com/vinaykumarsp/vinaysp master

将不起作用,因为https://github.com/vinaykumarsp/vinayspURL,而不是远程

Git中的remote是一个类似origin的短名称,其主要工作是为您存储URL。当你第一次克隆一些Git存储库时:

git clone https://github.com/user/repo.git

Git为您设置了一个名为origin的初始远程。大多数用户从不向此类存储库添加任何额外的远程,因此他们有一个名为origin的远程,这是一直使用的正确远程。

如果您确实有一个名为origin的远程存储URLhttps://github.com/vinaykumarsp/vinaysp,那么您确实需要:

git push --set-upstream origin master

在这里。

最新更新