From the course: Visual Studio: Source Control with Git and GitHub

Add a remote repository: PowerShell - Visual Studio Tutorial

From the course: Visual Studio: Source Control with Git and GitHub

Start my 1-month free trial

Add a remote repository: PowerShell

- [Instructor] In order to collaborate with other developers, we need to utilize a shared repository, for this course. We'll use GitHub for the Remote Repository Host. Currently we don't have a remote configured, therefore someone on our team needs to go to GitHub and create a Repo. We've seen how to do that, remember Terry Dactill and her account, she created this repository VsGitDemo, this private repo. And on this page we can learn more about the repository. The important thing for this demonstration is to get the URL from GitHub, and the easy way to do that is to go to this clone or download button and then click on this Copy button. Then let's switch to PowerShell. On my computer, I have a local repository and I need to connect it to GitHub. I do this by adding a remote to the local repo. Let's see if I have any existing remotes. I do not. Choose add and I'll hit Enter and we'll look at the syntax. Here it is, Git remote add a list of options which I will not use and then the name and the URL. We already have the URL. Now we need to decide on the name and by default most people use the word origin or the name origin. So let's choose that, paste in the URL, press Enter and check to see if we have a remote. And then we do. Now I have one remote and one local. You can have more than one remote. You can also create a word are called Mirrored Repositories and we'll talk more about that later in the course. So, at this point I'd like to start working with that remote repository. Let's check out some information about it, git remote show origin. This shows what we need to do for the next step. Remember that this is a private repository, so, I need to provide credentials to GitHub to allow it to let me connect to GitHub. Now, of course in a real project, it wouldn't just be Terry working on it, Terry would add multiple collaborators to her project and then all of us can connect using our current credentials. What I need to do in the next video is configure PowerShell or a command line to connect correctly to GitHub.

Contents