I will here under demonstrate how to get code hosted on a Git repository for the first time (aka clone the repository). The technical term to get code from a Git repository for the first time is to clone the repository. This is fine but there is actually a better way to grab code from Git repositories through Visual Studio.
Nevertheless, I often see people getting code from Git repositories by downloading a zip file, unzipping it and then opening it up in Visual Studio. It is a very convenient way to distribute code samples so that developers can browse the code through Visual Studio and eventually run it and toy with it. There are lots of open source projects hosted on Git repositories as well as bloggers and authors publishing demos, patterns and code samples on web-hosted Git repositories such as GitHub, Bitbucket, Codeplex (Note: Codeplex has several source control options and Git is just one of them)…. I hope that the information helps as this is the same method that I’ve taken to get used to the Git command-line commands while working at the same time.Cloning (getting) code from Git repository to Visual Studio. To define a main repository and push your work, just right-click on your Project name from the Solution Explorer, run your mouse over “Git (master)” and then select the “Push” option. I’ve added a new file and made a change to an existing file and the markers are very easy to understand. Since I’m working on a new Project, I’ll commit the new files by using the “Git – Pending Changes…” option.Īll of the files that have been committed have a green check mark next to them.
You should see something that’s familiar in the Solution Explorer since you’re probably used to see yellow plus symbols to denote that there are new files. You can open the Project folder through Windows Explorer to make sure that everything’s been created properly. Right-click on the Project name and then click on the “Git – New Repository” menu item. I’ll be creating a new Web Application Project but you can use an existing Project. While you have the Options window open, click on the “Git Source Control Provider Options” to make sure that the paths are set properly. Check the “Show all settings” box, select the “Source Control” option and set the plug-in to “Git Source Control Provider.”
Once you’ve completed the installations, launch Visual Studio 2010 and then change the source control plug-in by opening the Tools menu and selecting the Options menu item.
Next, you’ll need to pick up Git Source Control Provider at CodePlex for Visual Studio 201 and run the GitSccProvider.vsix to install the plug-in or access the Extension Manager from the Tools menu and install Git Source Control Provider.
Git Extensions offers a GUI that you can work with while you become accustomed to using the command-line and Git Source Control Provider is a plug-in for Visual Studio that includes functionality and features in the Solution Explorer that you’re probably used to.įirst, download and install Git Extensions. I won’t be taking an in-depth look at Git but I’ll be focusing on simplifying things a bit by using Git Extensions and Git Source Control Provider. If you’re moving into Git or it’s been something that you’ve been considering but think there’s a high learning curve involved, understanding and using the command-line is absolutely essential, however, there are ways to have a normal workflow using Git and Visual Studio 2010. In the past few months, I’ve spent a considerable amount of time working with Git and I thought I’d take a moment to share some information from the perspective of someone who has been using Visual Studio 2010 exclusively.ĭoing some work from the command-line isn’t a foreign concept to me but after having spent so much time getting used to working from Visual Studio directly, there was a bit of a learning curve involved because I’ll admit it, I’m a “clicker.” One of the luxuries that I’ve also been afforded is some time to play around with other technologies involved in the ALM process beyond Team Foundation Server itself. Introducing Build Server as an additional service.Handling migration services to the DiscountASP.NET TFS server.Publishing technical information through the DiscountASP.NET Blog.Sharing the knowledge that we’ve acquired in the TFS Knowledge Base.After taking point for our Team Foundation Server hosting service, it’s been a very busy past 10 months as I’ve been involved in: