CodeSamplez.com

Programming, Web development, Cloud Technologies

  • Facebook
  • Google+
  • RSS
  • Twitter
  • Home
  • Featured
    • C# Tutorials
      • LinQ Tutorials
      • Facebook C# API Tutorials
    • PHP Tutorials
      • CodeIgniter Tutorials
    • Amazon AWS Tutorials
  • Categories
    • Programming
    • Development
    • Database
    • Web Server
    • Source Control
    • Management
    • Project
  • About
  • Write
  • Contact
Home Source Control Beginners Guide To Use Git With Visual Studio

Beginners Guide To Use Git With Visual Studio

Rana Ahsan August 31, 2014 Leave a Comment


 Beginners Guide To Use Git With Visual Studio    

It’s not much long Microsoft started support for using git with Visual Studio(since last year, 2013). And now, recently, it added some core updates on its git support as mentioned on techcrunch. I am not using visual studio/.NET platform since a while and thus wasn’t aware of the latest staffs going on. I explored this integration of git with visual studio recently on free time, as I also was curious and did miss a lot of this git feature when I used to work regularly.

I think most of software developers who starts their career in .NET platform, might not aware much of git recently unless personally motivated. But I hope this new integration will help a lot to the developers to start using this awesome version control system to manage their source code.

If you haven’t used git at all and just starting out, you should better get a little familiar. You can consider reading an old post of mine which is written specifically for using git on windows

Git Plugin Installation:

My installed visual studio is ultimate 2013 version, which already shipped with it by default. In case you don’t have or using earlier version(say vs2 2012), you may consider downloading it from here.

Add Support For Git With Visual Studio Project:

When you create a new project, you should see an option at the right bottom corner that says ‘add source control system’, check this option. You will get option to specify source control vendor later on.

Now after adding test projects etc, at the final stage you will see two option on source control selection dialog. One is for git, another is for team foundation server. Select git here and we should be just fine. This will also execute git initialization command(‘git init’) in background.

Cloning A Remote Repository:

If you are planning to use an existing source code which might be on a remote git server, then you will want to avoid creating new project steps and directly use the cloning option on ‘team explorer’. You should get it under ‘team explorer’->’Connect To Team Project’ and use the ‘clone’ button under ‘Local Repositories’ section.
clone git repo visual studio

Basic Commit/Push Operations:

Commit:
Well, may be you have some good coding going on and now you have a stable state that you want to save. Which means you want to commit some changes, you will just have to click on the ‘team explorer’ tab, put a small commit message and submit on the dialog as like the below screenshot:
git-commit

Remote Push/Pull:
As you should already know, committing isn’t enough here to send your changes to server while using git! Which also need to be pushed remote server yet! To do so, you will have to use the ‘sync’ option on team explorer. As you might haven’t put any git remote address, you will get a field to enter that here:
git remote visual studio

View History/Revision Changes:

Until recently, you were able to only the basic git features as mentioned above. Now, you can see the code changes/compare with detailed history with Microsoft’s own CodeLens support. To get this support, you will need visual studio 2013 update 3. Now, Lets have a basic look.

Right click on the file you want to see history of, select ‘view history’ option. This should bring you up with a summary history page as below:
summary history

Now, to see detailed code change for a revision, select the revision, right-click and select ‘compare with previous’ option. This should take you to a gorgeous view of compare window as like below:
git-revision-compare-vs

What’s Next?

Get a try on github, currently the most popular collaborative open source software development platform.. To manage all your github projects, you can consider using github official tool for windows as well. Let me know if you have any questions/comments. Happy coding 🙂

Related

Filed Under: Source Control Tagged With: .net, git

About Rana Ahsan

Rana is a passionate software engineer/Technology Enthusiast.
Github: ranacseruet

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Email Subscription

Never miss any programming tutorial again.

Popular Tutorials

  • PHP HTML5 Video Streaming Tutorial
  • How To Work With JSON In Node.js / JavaScript
  • Generate HTTP Requests using c#
  • How To Work With C# Serial Port Communication
  • Facebook C# API Tutorials
  • How To Work With CodeIgniter Pagination
  • LinQ To SQL Database Update Operations In C#
  • Get Facebook C# Api Access Token
  • How To Work With Multithreaded Programming In C#.NET Application
  • Getting Started With HTML5 Web Speech API

Recent Tutorials

  • Building Auth With JWT – Part 1
  • Document Your REST API Like A Pro
  • Understanding Golang Error Handling
  • Web Application Case Studies You Must Read
  • Getting Started With Golang Unit Testing
  • Getting Started With Big Data Analytics Pipeline
  • NodeJS Tips And Tricks For Beginners
  • Apple Push Notification Backend In NodeJS
  • Web Based Universal Language Translator, Voice/Text Messaging App
  • How To Dockerize A Multi-Container App From Scratch

Recent Comments

  • intolap on PHP HTML5 Video Streaming Tutorial
  • manishpanchal on PHP HTML5 Video Streaming Tutorial
  • Rana Ghosh on PHP HTML5 Video Streaming Tutorial
  • ld13 on Pipe Email To PHP And Parse Content
  • Daniel on PHP HTML5 Video Streaming Tutorial

Archives

Resources

  • CodeSamplez.com Demo

Tags

.net apache api audio aws c# cache cloud server codeigniter deployment doctrine facebook git github golang htaccess html5 http image java javascript linq mysql nodejs oop performance php phpmyadmin plugin process python regular expression scalability server smarty ssh tfs thread tips ubuntu unit-test utility web application wordpress wpf

Copyright © 2010 - 2021 · CodeSamplez.com ·

Copyright © 2021 · Streamline Pro Theme on Genesis Framework · WordPress · Log in