Reputation: 272
I'm trying to create a new repository into github using Visual Studio 2017 community edition, but without success.
Could someone give me step by step instructions because I've come to a dead end.
I am using Visual Studio 2017 community edition. I have entered my GitHub credentials - connection is ok.
What I've tried so far. From VS2017
In Team Explorer I'll try to add repository
a) Repository settings, Add i.e. https://github.com/KettuJKL/WebPongTraining
b) Push to master goes to error
Pushing to https://github.com/KettuJKL/WebPongTraining Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
As you see, I can't find way to create a repository through VS.
Another way around. I'll create and repo to GitHub.
Try to sync
a) Can't fetch because no connected to the repository.
b) Sync/push fails because my project is behind the head (Where is the reset head, but don't loose changes command in the VS??)
b2) Tried reset hard. Lost whole project and settings to the GitHub. Back at square 1.
c) I can create a newBranch next to master, but can't merge it into the master at later time because master and newBranch have different commit histories.
Could someone please tell me those magic steps how to set up a project and sync it to the GitHub using VS2017 or VS2015?
Upvotes: 1
Views: 2816
Reputation: 635
I had to login to git, create a remote repository, then in VS2017, in the connect tab of Team Explorer, just click on clone, and enter the URL of the git repository you just created, which will then create a local git repository. from there, you can then click on new project to create the actual source code
Upvotes: 0
Reputation: 272
I found out through a friend what was the problem. Without any files Visual Studio is unable to understand new repository. Solution was to create new repository with Readme.md file and then clone that to my local drive.
Afther that I was able to work with the remote repository.
Upvotes: 2