How to Clone a Git repository in Visual Studio

In my trainings, often I get a question from junior developers that how to clone a Git repository in the visual studio? Perhaps it may be very simple for senior developers, however for the developers who struggle to get it right steps are discussed below,

Step 1

Find the URL of the remote git repository. For GitHub repository URL can be found as shown in the image below. Copy the URL from here.

image 

Step 2

Launch Visual Studio and from the View select Team Explorer. In the Team Explorer window select Clone.

clip_image002

On clicking Clone, you will get an option to provide the URL of the Git repo and the choose folder in which repository will be cloned. In the URL section paste the remote repository URL as whon in the below image:

clip_image004

As the last step click on the Clone and the remote Git repository will be cloned in the Visual Studio in the given folder. If everything goes right you will get success message as shown below.

clip_image006

I hope it helps. Thanks and Happy Coding.

An error was raised by libgit Category =Ssh error: solved git for Visual Studio

Have you come across the error as shown in below image?

clip_image002

You get the above shown error in Visual Studio while pulling changes from the git server. This error causes because you have local changes without the commit. In this scenario the visual Studio does not give very readable error message. Perhaps you may want to use git command for pull for more information on the error.

clip_image003

The git pull command clearly says that either commit the changes or stash them. If you are not sure about the local changes then better option is to stash them. Local changes can be stashed using the git stash command.

clip_image004

After stashing the local changes (you can commit also) run the git pull command to pull the remote changes from the git server. You should not get any error doing pulling the latest changes.

Hope it helps. Happy coding.

How to use DebugView to Log Entity Framework

In this post I will show you to use DebugView to log the Entity Framework. For detail discussion on the same topic you may want to learn more here:

Logging in Entity Framework on Steve Smith Blog

Profiling Database Activity in the Entity Framework by Julie Lerman

Download DebugView , unzip it and Run it as administrator. In Capture menu select the options as shown in below image,

image

Once the debugview is configured, you should configure the DataContext class as shown below. Enable database log to print on the debug window.

image

As the last step run the application using Entity framework without using Visual Studio or without attaching Visual Studio Debugger. In Visual Studio run the application using Ctrl+ F5. You should able to view the Entityframework log in Debugview as follows:

image 

The Debugview can be your good friend when you stuck with performance issues and want to log the queries.

Happy Coding.

Unable to index file: Permission Denied error in git add command

While working on an application, I had to commit changes to local Git Repository. It was usual task and I started with following command,

git add –A

To surprise git add command gave me error as shown in image below. Error message was clear that to a particular file there was Permission denied.

clip_image002

Note: I was working on a MVC application which had local database attached. Name of database was MoviesRTM.mdf.

I tried to commit using Visual Studio 2013 as well. Here also I got same error as shown in image below,

clip_image004

This can be solved by two ways either shutting down IIS Express or restarting Visual Studio. I was using IIS Express to host MVC application. You can shut down IIS Express by right click on IIS Express and click on Exit from context menu.

clip_image006

If this option is not working then try restarting Visual Studio.

Note: Restarting Visual Studio or Shutting down IIS Express may worked in this scenario because permission denies error was on a database file (extension mdf). And database was locally created.

After shutting down I was able to run git add command successfully.

Happy coding.

Getting Started with Git and GitHub

 

 

Read complete article on Falafel Blog

Who is not talking about Git or GitHub? In one of our recent user group meetings, someone asked how many Pull Requests have you done so far in any of open source projects on GitHub. I realized many developers in the room were puzzled with the phrase Pull Request. In this post I will explain some basic Git terminology and explore basic Git commands which will help you get started with Git. In a later post I plan to show you how you can work with Git-based Source Control and Visual Studio 2013.

Let us start with understanding basic terminologies:

Repository

A Repository  is a space where projects reside. Repository can be on a local computer or at an online host like GitHub or Team Foundation Server (TFS). If you are working in project then a Repository is basic unit of working . It will contain all the files, images etc. needed for the project. It should always contains a readme file, which describes the project

Read complete article on Falafel Blog