1

I've been trying to setup a GitHub repository for a Xamarin iOS project that I'm doing on my Mac.

When creating the project, this is the settings I chose Setup Image

However on I haven't been able to push to the GitHub repo I want to, I've tried to follow Microsoft's guide https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository but it hasn't worked due to Publish in version control being greyed out

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
George Smith
  • 55
  • 1
  • 8

2 Answers2

1

Or, if your project is already bound to a git repository, simply add the GitHub remote and push it there.

git remote add github URL_TO_GITHUB_REPO
git push github master

Afterwards, Visual Studio should allow you to push to Github as well as any older remotes that were added locally.

You can always remove the existing remote if you want to:

git remote remove origin
git remote rename github origin

See also: https://stackoverflow.com/a/52052063/736079

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
0

Before publishing your project to GitHub from Visual Studio, you must remove any source control :

If you have an existing project that is not already in version control, use the following steps to set it up in Git

Removing the .git folder and .gitgnore file should be enough. Then the "Publish in version control..." menu will be available (you might need to restart Visual Studio).

Source : https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository?view=vsmac-2019#publishing-an-existing-project

tscherrer
  • 48
  • 9