Share your code in Git
After you create your app, you can use a local Git repository to take snapshots of your code as you work. When you want to share your code with your team, publish it to Visual Studio Online. Or, if your team already has code in a TFS-managed Git repository, clone it to your machine.
As you work, you can fetch code from the server to keep your codebase current. When your code is ready to share, push it to the team's repository.
Take snapshots of your code
With your code project stored in a local Git repository on your dev machine, you can commit as early and as often as you like.
If you haven't already, create an app.
As you write your code, your changes are automatically tracked by Visual Studio. You can commit one or more specific changes to your local repository from Solution Explorer.
On the Changes page (Keyboard: Ctrl + 0, G), add a comment and then commit your changes.
These changes are now committed.
Publish your Git repository into your team project
If you haven't already, connect to your team project.
View your local Git repositories (Keyboard: Ctrl + 0, C).
Publish your repository into your team project.
You've now shared your code with your team.
Clone your team's code
If you're joining a project that already has its code shared in a Git repository that's managed by Visual Studio Online, clone the repository to your machine.
Clone the repository onto your dev machine.
Store the repository locally.
Now that you've got your copy of the code, you can open the solution.
Go to Solution Explorer (Keyboard: Ctrl + Alt + L).
Now you're ready to add your code to your local Git repository!
Pull changes from your team
Pull changes on a regular basis to ensure your code integrates well with the latest code from the team.
From the commits page (Keyboard: Ctrl + 0, O), fetch the commits to see any changes that your team has made.
When you're ready, pull these commits into your local repository.
The changes from your team are now integrated in your local repository.
Push your local commits to the server
When the code you've written on your dev machine is ready, you can push your changes from your local Git repository to the team project.
From the changes page (Keyboard: Ctrl + 0, G), make sure you've committed your changes.
Go to the commits page (Keyboard: Ctrl + 0, C).
Push your changes.
Q:How can I see what I've changed?
A:To see what you've changed, compare your changes with the last commit.
Q:How can I get more information about the commits from my team before I pull them?
A:Sometimes you need to see the details about incoming commits from your team. That way you can understand how a change will integrate with your work.
You can get details on the changes to each file.
Q:How do I associate my changes with related work items?
A:From the changes page you can run a query, and then drag a work item into the list of related work items.
Q:Can I use Git command-prompt tools?
A:Yes. Use Git from the command prompt.