不幸的是,Git在这里的建议是错误的。特别是:
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 push --set-upstream https://github.com/vinaykumarsp/vinaysp master
将不起作用,因为https://github.com/vinaykumarsp/vinaysp
是URL,而不是远程。
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
在这里。