Using Git with Visual Studio

These directions extend the Using Git from the Terminal or Git-Bash directions, and they provide the very basics to clone your repository into a Visual Studio project. Replace your credentials with these when completing this tutorial: user name is newuser, with some password, and the remote repository is http://projects.cs.uaf.edu/newuser.

After completing these steps, play around with the Team Explorer perspective to familiarize yourself with it. In addition, make some changes to your files and commit them after each change, then view your remote repository.

Installing Git in Visual Studio

This section assumes you have Visual Studio installed on your system. If you are using your own computer, install Visual Studio Tools for Git.

Setting Up Team Explorer

vs_clone_repo.png

Search for "Team Explorer", select "Clone", and add our server's information.

Cloning Your Repository

vs_enter_credentials.png

Enter your projects.cs.uaf.edu credentials.

vs_clone_successful.png

Look for the "Clone Successful" message.

Adding a Folder

You can add a homework folder if you choose.

vs_windows_explorer.png

Your folder should look similar to this.

Creating a New Project

We can create a new project for our first assignment.

vs_new_project.png

Create a new project.

vs_windows_explorer_2.png

The project exists on the file system.

Committing the New Project

Now let's add files and commit the project locally.

vs_choose_changes.png

Choose "Changes" in Team Explorer.

vs_configure_commit.png

Configure your username and email address in Git.

vs_configure_ignore.png

Create a .gitIgnore file with at least the entry *.opensdf so git will ignore this file.

Choose "Update" when you are finished.

vs_commit_untracked.png

Add a commit message and untracked files.

vs_commit_successful.png

Success message after choosing "Commit".

Syncing the New Project

Now let's synchronize the project with our remote repository on the Project Management server.

vs_choose_home.png

Choose "Home" in Team Explorer.

vs_choose_commits.png

Choose "Commits" under "Changes" in Team Explorer.

vs_choose_sync.png

Finally, choose "Sync" in Team Explorer.

vs_project_repo.png

Your Project Repository should now look like this.

vs_clone_repo.png (43.8 KB) John Quan, 07/24/2013 11:16 AM

vs_clone_successful.png (40 KB) John Quan, 07/24/2013 11:26 AM

vs_enter_credentials.png (66.5 KB) John Quan, 07/24/2013 11:28 AM

vs_gitignore_file.png (77.4 KB) John Quan, 07/24/2013 11:49 AM

vs_new_project.png (30.4 KB) John Quan, 07/24/2013 12:07 PM

vs_choose_changes.png (41.7 KB) John Quan, 07/24/2013 12:56 PM

vs_windows_explorer_2.png (33.9 KB) John Quan, 07/24/2013 01:01 PM

vs_configure_commit.png (46.2 KB) John Quan, 07/24/2013 01:05 PM

vs_windows_explorer.png (39.5 KB) John Quan, 07/24/2013 01:28 PM

vs_commit_untracked.png (64.1 KB) John Quan, 07/24/2013 01:43 PM

vs_gitignore_file.png (99.2 KB) John Quan, 07/24/2013 01:46 PM

vs_configure_ignore.png (63.3 KB) John Quan, 07/24/2013 01:51 PM

vs_commit_successful.png (76.4 KB) John Quan, 07/24/2013 01:53 PM

vs_choose_home.png (52.2 KB) John Quan, 07/24/2013 02:03 PM

vs_choose_commits.png (43.3 KB) John Quan, 07/24/2013 02:06 PM

vs_choose_sync.png (43.7 KB) John Quan, 07/24/2013 02:10 PM

vs_project_repo.png (60.9 KB) John Quan, 07/24/2013 02:18 PM