[英]Visual Studio 2019 is pushing only git files to remote repository
When I create a .NET Core project in Visual Studio 2019 and add it to source control the local repo is created without any errors.当我在 Visual Studio 2019 中创建 .NET 核心项目并将其添加到源代码控制时,本地存储库的创建没有任何错误。 But when I try to use Team Explorer to publish the local repo to a private BiBucket repository, only the.gitattributes and.gitignore files are pushed to the remote master.
但是当我尝试使用 Team Explorer 将本地 repo 发布到私有 BiBucket 存储库时,只有 .gitattributes 和 .gitignore 文件被推送到远程 master。 I cannot see any of my project files.
我看不到我的任何项目文件。
Any suggestions?有什么建议么?
You need to do a git add
on the files in your project.您需要在项目中的文件上
git add
。 I'm not sure how that's done in Visual Studio.我不确定这是如何在 Visual Studio 中完成的。
The first thing is you need to check the status of git using git status
.首先,您需要使用
git status
检查 git 的状态。 After that, you can use git add.
之后,您可以使用
git add.
to add the file you want to commit.添加要提交的文件。
Example of my case:我的案例示例:
git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: package-lock.json
modified: package.json
modified: public/index.html
modified: src/App.js
right-click on the file in Visual studio and from git option chose Add Ignored file to source control and when you did just push your changes右键单击 Visual Studio 中的文件,然后从 git 选项中选择将忽略的文件添加到源代码控制,当您刚刚推送更改时
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.