• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • 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

CodeSamplez.com

Programming, Web development, Cloud Technologies

You are here: Home / Source Control / Beginners Guide To Use Git With Visual Studio

Beginners Guide To Use Git With Visual Studio

August 31, 2014 by Rana Ahsan Leave a Comment

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 🙂

Share If Liked

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)

You may also like

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

About Rana Ahsan

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

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Follow Us

  • Twitter
  • Facebook

Top Posts & Pages

  • How To Work With JSON In Node.js / JavaScript
    How To Work With JSON In Node.js / JavaScript
  • PHP HTML5 Video Streaming Tutorial
    PHP HTML5 Video Streaming Tutorial
  • How To Work With C# Serial Port Communication
    How To Work With C# Serial Port Communication
  • LinQ Query With Like Operator
    LinQ Query With Like Operator
  • Facebook C# API Tutorials
    Facebook C# API Tutorials
  • Using Supervisord Web Interface And Plugin
    Using Supervisord Web Interface And Plugin
  • Get Facebook C# Api Access Token
    Get Facebook C# Api Access Token
  • Beginning Codeigniter Application Development
    Beginning Codeigniter Application Development
  • Control HTML5 Audio With Jquery
    Control HTML5 Audio With Jquery
  • How To Use Hotkeys/Keyboard Events In WPF Application Using C#
    How To Use Hotkeys/Keyboard Events In WPF Application Using C#

Recent Posts

  • Building Auth With JWT – Part 2
  • Building Auth With JWT – Part 1
  • Document Your REST API Like A Pro
  • Understanding Golang Error Handling
  • Web Application Case Studies You Must Read

Tags

.net angularjs apache api audio auth authenticatin aws c# cloud server codeigniter deployment docker doctrine facebook git github golang htaccess html5 http javascript jwt linq mysql nodejs oop performance php phpmyadmin plugin process python regular expression scalability server smarty socket.io tfs tips unit-test utility web application wordpress wpf

Footer

Archives

Follow Us

  • Twitter
  • Facebook

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Copyright © 2023