将 git 与 VS Code 连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48589376/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Connect git with VS Code
提问by fxvlad
How to configure VS Code to work with git? I'm using the standard scm provider in VS Code. I installed git on my pc, initialized the repository in a folder, made some changes and VS shows that it has been committed but I don't see in on my github, and when I want to pull from git VS shows "Your repository has no remotes configured to pull from."
如何配置 VS Code 以使用 git?我在 VS Code 中使用标准的 scm 提供程序。我在我的电脑上安装了 git,在一个文件夹中初始化了存储库,做了一些更改,VS 显示它已提交,但我在 github 上没有看到,当我想从 git 中提取时,VS 显示“你的存储库有没有配置可以拉出的遥控器。”
回答by dstrants
You first need to add your GitHub repo as a remote! To do this you can follow the Official Guide.
您首先需要将您的 GitHub 存储库添加为远程!为此,您可以遵循官方指南。
git remote add origin https://github.com/user/repo.git
#optionals below just to verify
git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
Then you can push your local commits with official guide
然后你可以使用官方指南推送你的本地提交
git push -u origin master
You can add remote directly from VS Codeas introduced here
您可以从远程直接添加VS代码为引入这里
回答by quickblueblur
You need to push your local commits to your remote. Check out Git Status Bar Actionsand Remotes.