我无法将VS代码存储库发布到GitHUB [英] I cannot publish my VS Code repository to GitHUB

查看:127
本文介绍了我无法将VS代码存储库发布到GitHUB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Windows笔记本电脑中有一个项目,并且正在使用MS Visual Studio代码.

I have a project in my windows laptop and I'm using MS Visual Studio Code.

我在Windows上安装了git,添加了一个存储库并提交了我的代码.

I installed git on windows, addded a repository and commited my code.

在GitHUB上创建一个存储库,并使用以下命令将其添加到本地:

Created a repository on GitHUB and added to my local with this command:

git remote add Codeigniter-starter-kit https://github.com/rostamiani/Codeigniter -starter-kit

现在,当我尝试发布branc时,出现此错误:

Now when I try to publish branc, this error comes up:

git push -u Codeigniter-starter-kit master到 https://github.com/rostamiani/Codeigniter-starter-kit ! [已拒绝]
master-> master(先获取)错误:无法将某些引用推送到 " https://github.com/rostamiani/Codeigniter-starter-kit "提示: 更新 被拒绝,因为遥控器包含您确实暗示的工作:否 在本地.这通常是由另一个存储库推送引起的 提示:到相同的参考.您可能需要先集成遥控器 更改提示:(例如'git pull ...'),然后再次推送.提示:请参阅 有关详细信息,请参见"git push --help"中的关于快进的注意事项".

git push -u Codeigniter-starter-kit master To https://github.com/rostamiani/Codeigniter-starter-kit ! [rejected]
master -> master (fetch first) error: failed to push some refs to 'https://github.com/rostamiani/Codeigniter-starter-kit' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

遥控器中只有一个自述文件.我尝试将其拉出,这次是错误:

There is just a readme in the remote. I tried to pull it and this time this is the error:

git pull-标签 git show:application/controllers/Test.php在后台自动打包存储库以获得最佳性能.请参阅"git help gc" 用于手动整理房间.警告:有太多无法到达的松动 对象;运行"git prune"将其删除.没有追踪 当前分支的信息.请指定您在哪个分支 想要合并.有关详细信息,请参见git-pull(1).

git pull --tags git show :application/controllers/Test.php Auto packing the repository in background for optimum performance. See "git help gc" for manual housekeeping. warning: There are too many unreachable loose objects; run 'git prune' to remove them. There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.

git pull

如果您希望为此分支机构设置跟踪信息,可以这样做 与:

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to = Codeigniter-starter-kit/master

git branch --set-upstream-to=Codeigniter-starter-kit/ master

git show:application/controllers/Test.php git状态-z -u git symbolic-ref --short头 git rev-parse主 git rev-parse --symbolic-full-name master @ {u}致命:没有为分支"master"配置上游 git for-each-ref --format%(refname)%(objectname)--sort -committerdate git remote --verbose怎么了?

git show :application/controllers/Test.php git status -z -u git symbolic-ref --short HEAD git rev-parse master git rev-parse --symbolic-full-name master@{u} fatal: no upstream configured for branch 'master' git for-each-ref --format %(refname) %(objectname) --sort -committerdate git remote --verbose What's wrong?

推荐答案

您可以执行以下两项操作之一:

You can do one of two things:

  1. 使用git pull origin master而不是git pull明确拉出master分支.

  1. Explicitly pull the master branch with git pull origin master instead of just git pull.

使用git push -f origin master强制推送本地代码.这将覆盖GitHub存储库上的master分支,并且您将丢失自述文件.

Force push your local code with git push -f origin master. This will overwrite the master branch on your GitHub repo and you will lose the README file.

要了解有关Git基础知识的更多信息,建议阅读 Pro Git的前三章. .这将为您提供成功使用git并从诸如此类的问题中恢复所需的工具.

To learn more about the basics of Git, I suggest reading the first three chapters of Pro Git. This will give you the tools you need in order to use git successfully and to recover from problems such as this.

这篇关于我无法将VS代码存储库发布到GitHUB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆