繁体   English   中英

Visual Studio 2019 仅将 git 文件推送到远程存储库

[英]Visual Studio 2019 is pushing only git files to remote repository

当我在 Visual Studio 2019 中创建 .NET 核心项目并将其添加到源代码控制时,本地存储库的创建没有任何错误。 但是当我尝试使用 Team Explorer 将本地 repo 发布到私有 BiBucket 存储库时,只有 .gitattributes 和 .gitignore 文件被推送到远程 master。 我看不到我的任何项目文件。

有什么建议么?

您需要在项目中的文件上git add 我不确定这是如何在 Visual Studio 中完成的。

首先,您需要使用git status检查 git 的状态。 之后,您可以使用git add. 添加要提交的文件。

我的案例示例:

 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

右键单击 Visual Studio 中的文件,然后从 git 选项中选择将忽略的文件添加到源代码控制,当您刚刚推送更改时

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM