After scrolling around Visual Studio, I finally found an answer that took a lot longer than it should.
To take an existing project without source control and put it into the existing GitHub repository (this is important), this process is simple but complicated, since your first desire is to use Team Explorer, which is wrong, and therefore you have problems
First add it to the version control system. There are several explanations for this above, and each goes so far.
Now it opens an empty LOCAL repository, and a trick that no one ever talks about is to completely ignore Team Explorer and go to Solution Explorer, right-click on the solution and click Commit.
Then it captures all the differences between your existing solution and local storage, essentially updating it with all these new files. Give it the default commit name 'source files' or something else that floats on your boat and commits.
Then just click “Sync” on the next screen and paste in the EMPTY GitHub URL. Make sure that it is empty, otherwise you will have conflicts of the main branches, and it will not allow you. So either use the new repository or delete the old one that you messed up earlier. Keep in mind that this is Visual Studio 2013, so mileage may vary.
Helpful Jun 19 '15 at 20:18 2015-06-19 20:18
source share