Results 1 to 3 of 3

Thread: How to connect Visual studio 2022 to GitHub

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2011
    Location
    Melbourne
    Posts
    37

    How to connect Visual studio 2022 to GitHub

    I have created a GitHub account and repository.
    I now need to connect Visual Studio 2022 to that repository.

    I have gone:
    • Visual Studio > View > Team Explorer tab
    • Click on the "Manage Connections" button,
    • but I cannot see "Connect to GitHub."
    VS showed a message like: for git options see VS menu > Git
    I did not know how to proceed

    I have tried to install GitHub Extension for Visual Studio" but could not find it on the list. I went:
    • Visual Studio > "Extensions" > "Manage Extensions." > online
    • Could not see the GitHub Extension.

    How do I proceed?

    Also. I have ticked the box to get instant email notifications of responses, but I'm not getting the emails.

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: How to connect Visual studio 2022 to GitHub

    There should be a menu called "Git", probably a couple of items to the right of the "file" menu

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: How to connect Visual studio 2022 to GitHub

    I thought I could provide a better set of steps, but now that I look at it, I think I'll leave a bunch out. I'm no expert at Git. There are numerous options and approaches, of which I use very few.

    First off, I use GitLab because I prefer the fact that I can create numerous private repos. The rules for GitHub and GitLab seems to change every other year, or so. I think they are virtually the same, so the steps for one are likely much like, or the same to, steps on the other. Still, these are the steps I (think) I follow for GitLab:

    When I create a new project (or have an existing project) that I want to push to GitLab, there is a Git Changes tab by Solution Explorer (it's one of the tabs, for me, though I have never bothered to see if it is it's own entity, so I always thought it was part of Solution Explorer). That has the option to Create Git Repository (or clone one). Click that.

    This brings up a form that allows you to choose the new remote or to push to an existing remote. I always opt for the latter. Is this best? Since I'm using GitLab, I think it might be my only option. GitHub is an option on that form, so you might be able to just push straight to GitHub, but only if you haven't already gone into GitHub and created an existing repo. Since you have, then Existing Remote is probably right for you, as well.

    In my case, I always go into GitLab and create an repo. That takes you to a fairly busy page that includes a ReadMe.MD down towards the bottom (I seem to remember that GitHub worked this way, as well). Down there, I have a section for Add Your Files, which includes a line like this:

    git remote add origin "some HTTPS URL here"

    You want to copy the URL from that line. That's what gets pasted into the URL textbox for the Existing Remote in VS. That may well be all it takes. I don't remember any other steps, aside form clicking a "Finished", "OK" or some other such button.

    That's about as much as I can say offhand.
    My usual boring signature: Nothing

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width