简体   繁体   English

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

[英]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.

相关问题 Visual Studio 2019“推送到远程存储库时遇到错误:无法推送到远程存储库...” - Visual studio 2019 "Error encountered while pushing to the remote repository: Failed to push to the remote repository..." Visual Studio 2019 停止推送到 Git - Visual Studio 2019 Stopped Pushing to Git Git没有将新文件推送到远程存储库 - Git not pushing new files to remote repository Visual Studio 在 git 上推送到错误的 URL 推送:将分支推送到远程存储库时遇到错误:Git 失败并出现致命错误 - Visual Studio pushing to wrong URL on git push: Error encountered while pushing branch to the remote repository: Git failed with a fatal error Git-推送到远程存储库 - Git - pushing to remote repository Visual Studio 2019-如何添加Git远程 - Visual Studio 2019 - How to add Git remote 使用 Visual Studio 2019 将更改推送到子存储库 - Pushing changes to sub-repository using Visual Studio 2019 Visual Studio Code - 连接到远程 Git 存储库并将本地文件推送到新的远程存储库 - Visual Studio Code - Connect to a remote Git repository and PUSH local files to a new remote repository 在 Visual Studio 2019 中添加 git 中的所有文件 - Adding all files in git in Visual Studio 2019 Visual Studio错误推送到远程git-git-tfs迁移 - Visual Studio error pushing to remote git - git-tfs migration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM