Click here to Skip to main content
15,888,521 members
Articles / DevOps / Git
Tip/Trick

How to Add Source Codes to GIT Source Control and Publish

Rate me:
Please Sign up or sign in to vote.
4.33/5 (4 votes)
11 Jul 2015CPOL2 min read 10.3K   4  
How to add source codes (solution) to GIT source control and publish it in www.VisualStudio.com site.

Having trouble writing or posting articles? These articles aim to gather together tips and tricks from authors and mentors to help you write great articles.

Introduction

With many reasons, I decided to use GIT instead of TFS. Anyway, I want to teach you how to add your source codes (Solution) to GIT source control and publish it in http://www.VisualStudio.com site.

Step 1

First of all, go to http://www.VisualStudio.com site, login and then select your account.

Step 2

Create your repository:

Image 1

Step 3

After creating your repository, automatically site redirect you to the repository section. Now  click on [Code] link:

Image 2

Step 4

You will see the code section of your repository:

Image 3

Note: In this address, you see the [_git] in your address bar. This part of url address is too important. We need this address for publishing our source code in visual studio application to http://www.VisualStudio.com site.

Step 5

Now create a new application or open some of you application. After opening of your application, in solution explorer, right click on you solution and in left menu, click on "Add Solution to Source Control":

 

Image 4

Step 6

After clicking on "Add Solution to Source Control" menu item, a dialog box will be appear. In this dialog box select Git Source Contorl and then click on OK button:

Image 5

Step 7

After step 6, you will see a green cross icon in left site of each of your source code files:

Image 6

Step 8

For adding "Team Explorer" view in visual studio, select View sub menu and then click on "Team Explorer" menu item:

Image 7

Step 9

Again in solution explorer, right click on your solution and in opened menu select "Commit":

Image 8

Step 10

In "Team Explorer" dialog and in its "Chagnes" part, you should write your comment or description about this committing and the click on "Commit" button:

Image 9

Step 11

After clicking on "Commit" button, you will see this message: "Commit {random characters} created locally...":

Image 10

Step 12

In "Team Explorer" dialog and in its "Home" part, you should click on "Unsynced Commits":

Image 11

Step 13

You should login in visual studio application by your own Microsoft Live account, and after loging, you will see your name in top and right side of visual studio application

Image 12

Step 14

In "Team Explorer" dialog and in its "Unsync Commits" part, write your repository url that we show you in step 4, and then click on "Publish" button

Image 13

Image 14

After clicking on "Publish" button you will see:

Image 15

and then:

Image 16

In this step, you will see this message: "The origin remote has been added and the current branch has been published."

Step 15

The last step is to click on "Sync" button, and then you will see this message: "Successfully synchronized incoming and outgoing commits."

Image 17

Note

If you open the container folder of your application, besides of your .sln (Solution) file, you will see one folder and two files. This means that your application added to GIT source control.

Image 18

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Sematec Ins.
Iran (Islamic Republic of) Iran (Islamic Republic of)
My experiences are:

HTML 5.0, CSS 3.0
JQuery, Angular JS, Bootstrap

MVC 5.0, WEB API, c#

My Site URLs:
http://www.IranianExperts.ir
http://www.IranianExperts.com

My Yahoo Group URL: http://groups.yahoo.com/group/iranianexperts

Mobile: 0098-912-108-7461
Address: Tehran, Tehran, Iran

Comments and Discussions

 
-- There are no messages in this forum --