Push to Github Visual Studio Community Mac - macos

I've been trying to setup a GitHub repository for a xaramin 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 Microsofts 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

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

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

Related

Connect to Git hosted on VSTS on Mac using XCode

I am trying to connect to a Git repository hosted on VSTS from a Mac machine in Xcode 9. I tried cloning the project using Xcode but it gives me authentication failure error.
I don't get this problem in Windows. I have also tried creating a Personal Access Token in my VSTS account profile and used the secret key but that too doesn't work.
References:-
https://learn.microsoft.com/en-us/vsts/git/share-your-code-in-git-xcode
https://learn.microsoft.com/en-us/vsts/git/set-up-credential-managers
Am I missing on something? Please let me know if I can provide more details.
Update
Somehow I can clone the project to my local using Visual Studio on Mac after generating Git credentials through VSTS. Strange that it does not work with the XCode.
I have not used VSTS, but this answer shows how to connect to a remote repository that's not a GitHub repository in Xcode 9. Start by opening the source control navigator by choosing View > Navigators > Show Source Control Navigator.
The next step is to add a remote branch for your VSTS repository. Select the Remotes folder in the source control navigator, right-click, and choose Add Existing Remote.
Enter the URL of your VSTS repo in the Location text field. Click the Add button to finish adding the remote repository.
At this point you have an empty remote repository in Xcode. The last step is to push your local Xcode repository to the remote repository. Choose Source Control > Push in Xcode to do the push.
You will be asked for a username and password for the remote repository. According to the first link from Microsoft in your question, you should enter your VSTS username as the username and the personal access token as the password.

Visual Studio: How to create project from existing GitHub repository?

I came from Eclipse background and I am apparently missing something.
There is an existing GitHub project with JS code in it and I would like to start adding TypeScript nature to it, one type at a time.
I have followed this tutorial to clone project from GitHub to my "local git repository". Now the Team Explorer window displays it as local repository and I can commit changes etc but it's not a project and I don't know how to open it as a project (I want to open it as TypeScript project).
The workflow I was used to from Eclipse would simply be New -> Other -> SVN -> Checkout Projects from SVN that is automatically followed by New Project Wizard.
How do I clone existing JS project from GitHub and make it a TypeScrip project while keeping the existing folder structure?
EDIT: I am using Visual Studio Express and I am limited to the native Git extension.
What I typically do in this situation;
Clone repository using Git in Visual Studio; or use GitHub for Windows and Clone in Desktop from the Git project's web page. This will create a directory (repository) with the project files where you specify.
In visual studio, File->New->create a new project from existing code. From the wizard, select C# or C++ (whatever your choice it does not really matter)
The wizard requires a project file location: give the location of the Git folder that contains the project files (where you cloned the project's repository).
The Wizard requires a unique project name, for example you can use the name of the Git project with VisualStudio (or VS) appended to the end.
Git will now be in sync and you will be able to see all the git files. Making changes will check them out and allow you to push them to the project etc...
***** By default Git will want to check in the newly created .csproj file that Visual Studio creates to allow you to open the project in Visual Studio. You will just want to drag this into the excluded changes section because most likely the project in question will not be using Visual Studio.**
I solved this by opening the site as a website. File->Open->Website.
No Project Files/Solution files required. It just opens up the folder in the solution explorer.
To make it a typescript project, just add a tsconfig.json file to the directory.
Do you have any code in that repository yet that you want to open? I'm guessing not in which case you need to create a new VS project (just like you'd create a new Eclipse project and have it in your workspace)
Go to File, New..., Project... and pick the project type that you want. Give the project a name and set the location to be a folder INSIDE the folder that you cloned your Git repo to earlier (i.e. c:\mycode\mygitproject). Also give your solution a name. A "Solution" in Visual Studio is a wrapper for the projects inside it, kinda like the closest thing to a workspace or a working set in Eclipse but not quite the same thing.
Then Visual Studio should then be smart enough to pick up that this is in Git repo and allow you to commit locally as well as push/pull to GitHub etc.
Finally, while I work with the team that created the Visual Studio Tools for Git, I'd still highly recommend that you get hold of a command line should you want to do some more powerful stuff with Git other than simply committing code, push/pulling changes and branching or merging branches. If you are working against GitHub then you might also want to install GitHub for Windows which will bring some Git tools with it or you can install Git for Windows and also install Posh-Git separately. All of these things work together and give you the maximum power of Git but you can pick and choose the tool that works best for you. You'll probably find a workflow of Clone using GitHub for Windows, commit/push/pull/branch/merge in VS and then Posh-Git if you do more advanced stuff or want to hand-tweak settings.

Configure Git Source Control Provider For Development Team

I'm totaly newbie to Source Control idea, so please be kind.
My situation is that we are a development team which contains 2 developers and 1 designer.
We use Visual Studio 2010 and we need to use a Git as a Source Control.
I've installed Git Source Control Provider and GitExtensions using Extensions Manager on all machines.
But there is only one thing I don't get it, how can I configure every Git on every machine to find a central repositry where we can Push and Update all work in one place?
Does that mean everyone will take a copy of a solution into his own machine (Locally) and configure Git to a repositry OR are we going to run on the same solution?
Honestly, I have not found articles regarding this issue and how teams on same project on Visual Studio 2010?
Git is distributed version control system means that whenever you clone a repository you can work on your copy and commit too. Once you done you can push the commits to remote repository.

Using a BitBucket Repository Locally with Visual Studio

My company has just begun using BitBucket with Mercurial for version control and I am having a heck of a time integrating it locally with Visual Studio 2010. I can easily create a folder on my local system and clone the BitBucket repository using TortoiseHg and it brings down all the files appropriately. However, when I try to create a Visual Studio project in the same folder, it insists on creating it's own sub-folder for the project files, leaving my version controlled source files out of the project. When I try to do it the opposite way, creating my solution in Visual Studio first, TortoiseHg will not let me clone my repository into the same directory, saying that it needs a new folder. All of my google-foo seems to be coming up fruitless.
Anyone have a clean way of setting up a cloned repository from which to work locally in Visual Studio using Mercurial and BitBucket?
You can
Create your Visual Studio project.
Right-click the project folder and choose TortoiseHg -> Create Repostory Here.
Add and commit files in TortoiseHg.
Push the repository into a new empty repository on Bitbucket. To push, you use the synchronize view and add a new path to the repository. Name the path default and it will become the default push and pull path.
The important point is that you can always push into an empty repository. This is how you copy a repository you've worked on locally to Bitbucket: create a new empty repository online and push to it.

Uploading project to GitHub from Visual Studio 2010

I have a GitHub account.
I have a Visual Studio 2010 with Git Extensions and Git Source Control provider installed.
I have created a clean project. How do I upload it to GitHub?
P.S. A tutorial on this particular topic would be fine.
In order to upload a Visual Studio Project to GitHub one needs to perform a push operation in GitExtension commit dialog.
Basically syncing the project with GitHub server is called "push"ing in Git terminology.
In order to be able to push, one needs to do the following:
Create a local repository. This is covered in detail by both GitHub and GitExtensions manual.
Create a repository online from GitHub account. This is covered in detail by GitHub help.
Map a local repository to an online one. This requires going to Manage Remotes dialog of GitExtensions (accessed via Git->Manage Remotes menu item in Visual Studio main menu) and saving a new instance of a remote repo.
Then, at commit, choose to "Commit & push", and point push to a remote repo created in step 3.
Create a new repository in your github account. It will give you the step by step instructions for you.

Resources