Learn to use Visual Studio, Visual Studio Online, Application Insights and Team Foundation Server to decrease rework, increase transparency into your application and increase the rate at which you can ship high quality software throughout the application lifecycle
More videos »
By: Andy Lewis and Matthew Mitrik
Today we're here to help you:
Got the latest version of Visual Studio with Git? If not, click here.
To use the Visual Studio client tools you'll need to install Visual Studio 2012, apply Visual Studio 2012 Update 2, and finally install Visual Studio Tools for Git. If you want to use Team Foundation Service, you can sign up for free.
You can specify three kinds of Git settings, listed in order of supersedence:
For more details on Git settings, see Customizing Git - Git Configuration and git-config command.
Global settings are scoped to each user on the client dev machine. So for example if you share a dev machine with Julia, then you and she can each have different settings.
User Name and Email Address: Git associates each commit you create with your name and email address. When you first begin using Visual Studio with Git on your dev machine, if you begin by cloning from a Git team project, then Visual Studio fills these in for you.
Default Repository Location: You can specify the default root directory where you want to create or clone new local Git repositories.
Author images: You can use images to more easily see the author of each commit.
If your Git repo remote origin is in a TFS Git team project, team members can specify their images in their TFS profiles. How?
Note: Enable download of author images from 3rd party source also works for TFS Git team projects in cases where the author has not supplied a profile image.
An example of how author images enhance the collaborative experience:
Before you can modify Git repository settings, you must have a local Git repo opened in Team Explorer. See Create, connect, and publish using Visual Studio with Git.
Repository settings are scoped to each local Git repository on the dev machine. Typically you want to commit these files so that everyone else on your team uses the same repository settings on their dev machines.
Ignore File: To avoid checking in temporary non-source items such as binaries, you can specify a .gitignore file. See Ignoring files and gitignore(5) Manual Page.
Attributes File: To specify options such as how the system handles line-breaks, you can specify a .gitattributes file. See Customizing Git - Git Attributes.
Did you create your Git repo using Visual Studio 2012 QU2 CTP3 or earlier?
Edit the .gitattributes file
and look for this:
and if you find it, replace it with this:
(The first instruction normalizes line endings to CRLF in your working copy of the file when you modify it. We've determined that this isn’t the recommended approach by the community. We recommend you use the second instruction instead.)
Tip: If your repository does not have these files, you really should use Visual Studio to add some default files that apply the most typically useful settings. Doing so will avoid distraction and potential clutter in your repo from non-source files such as locally-built binaries.
After you make changes to your repository settings files, you should commit them.
You can modify all Git settings from the command prompt using the git-config command.
If you have not already done so, install the Git command-prompt tools.
Open the command prompt.
Enter the command. For info on the commands you can use, see Customizing Git - Git Configuration and git-config command.