简体   繁体   中英

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. 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. I cannot see any of my project files.

Any suggestions?

You need to do a git add on the files in your project. I'm not sure how that's done in Visual Studio.

The first thing is you need to check the status of git using git status . After that, you can use 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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