# Saturday, January 30, 2016

I admit that I am a novice when it comes to Git. But I recognize the importance of this version control system, so I documented the most important commands.

Git is a distributed version control system, so it is necessary to commit changes to a local repository (a repository on your local computer) before pushing those changes to a central repository that can be shared by others.

Commands

My needs are simple. In the vast majority of cases, I want only to get the latest code, make my changes, save them to a local repository, and share those changes with others. Git contains a lot of commands, but the following git commands suffice for most of my needs:

  • git init
  • git config
  • git add .
  • git pull
  • git commit
  • git push

Here is a brief description of each command:

git init

Intialize an empty Git repository

git config

Store information, such as username and email address in a local config file, so you don't need to re-type it later.

git remote add

Associate the local git repository with a remote repository

git add

Adds files in the current folder to the git repository

git commit –m “Comment about change

Commits changed files to the local repository. The “-m” switch allows you to provide a comment describing the code you are committing.

git pull repositoryname branch

Retrieves code from the remote repository and merges it with your local code

git push repositoryname branch

Pushes any changes from your local repository to a central repository

Workflow

My usual workflow is below. It assumes my code is in the local directory c:\development\MyProject and that the remote repository is named “myproj”.

Starting a new project

At github.com, create a new repository

cd \development\MyProject
git init
git config --global user.name "David Giard"
git config --global user.email djgiard@hotmail.com
git remote add origin https://github.com/DavidGiard/nameofmynewrepository.git
git add .

git commit -m "Initial revision"
git push origin master 

After I make a change and test it and it seems to work:

git pull origin master
// Test that the application still works after pulling and merging other developers’ changes
git add .
git commit -m "My change"
git push origin master

ALM
Saturday, January 30, 2016 9:23:21 PM (GMT Standard Time, UTC+00:00)
# Monday, January 25, 2016
Monday, January 25, 2016 12:09:00 PM (GMT Standard Time, UTC+00:00)
# Thursday, August 27, 2015

Learn how to deploy to an Azure web app from a local Git repository.

ALM | Azure | GCast | Video
Thursday, August 27, 2015 9:30:00 PM (GMT Daylight Time, UTC+01:00)
# Wednesday, January 21, 2015

It's hard to imagine a scenario in which a software developer would not benefit from source control. GitHub provides a repository for developers to store their source code and other digital assets.

To use GitHub, you will need to create an account at https://github.com/ and log in.

To set up a new repository, click the "+" icon next to your name and photo at the top right of the main GitHub page. This displays a dropdown list (Fig 1).

1-NewRepository
Fig 1

Select "New repository" from this list.  The "New Repository" page displays (Fig 2)

2-CreateRepository 
Fig 2

At the "Repository name" textbox, enter a name for your repository. This should be brief, but enough to identify the project to you and others.

At the "Description" textbox, you may enter a short description of the project, if you like. This is useful if you want others to contribute.

Use the radio buttons to select whether this will be Public (anyone can view the files in the repository) or Private (only those you invite can see the files). You can only create a private repository if you have a paid GitHub account. Free accounts can only have public repositories.

Checking the checkbox labeled: "Initialize this repository with a README" will create a README.MD file in your repository. This file is displayed on the main page of your project below the list of other files. It should contain text and Markdown language. For a description of Markdown, check out http://daringfireball.net/projects/markdown/.

There are two dropdowns at the bottom of the page: "Add gitignore" and "Add a license".

The "Add gitignore" dropdown (Fig 3)allows you to quickly create gitignore file.

3-GitIgnore 
Fig 3

A gitignore contains a list of files that might be on your disc, but that you don't want in source control. These might be user configuration files or binary output files.
Selecting a type of projects creates a gitignore file containing files typically ignored by that project type. For example, if I select "Visual Studio" from the "Add gitignore" dropdown, a file will be created that tells GitHub to not check in "SUO" files or files in my "bin" folder.  Of course, you can always edit the gitignore file after it is created.

The "Add a license" dropdown (Fig 4)allows you to assign a license to the files in your repository.

4-License
Fig 4

The license dictates how others can legally use these files and programs - for example, whether they can make money off of code that you share here.  There is a good description of each software license at http://opensource.org/licenses/.

After you complete the form, click the [Create Repository] button. Your repository will be created in a few seconds.

Wednesday, January 21, 2015 3:20:00 PM (GMT Standard Time, UTC+00:00)
# Saturday, July 27, 2013

Are you a TFS user or interested in using this product? In the past, it was necessary to install TFS onto a central server or virtual machine before using it. No more. Now, Team Foundation Services allows you to access a TFS server hosted by Microsoft.

The service is free for small teams (<5 people) while it is in Preview, but I have not seen any future pricing announcements.

Get started by navigating to visualstudio.com and signing up for an account. Note the URL, up to ".visualstudio.com". This is the server name. You will need this to integrate with Visual Studio solutions. In my case, it is "https://giard.visualstudio.com".

At the home page, click the [New Team Project] button (Fig. 1)

TFSvc1-Welcome[1]

The "Create Team Project" dialog displays (Fig. 2). Enter a project name and description;

TFSvc2-CreateTeamProject[1] 

Next, select a Process template. The choices are:

  • Microsoft Visual Studio Scrum 3.0 - Preview
  • MSF for Agile Software Development 7.0 - Preview
  • MSF for CMMI Process Improvement 7.0 - Preview

Finally, select a Version Control repository. Currently, TFS and Git are supported. Click [Create Project] and you will be ready to start using TFS within a few seconds.

The navigation is simple and intuitive.

You can add and remove team members by clicking the Manage All Members link.

You can enter a new Task, Bug, Issue, Feature, or Test Case using dialogues similar to those found in the Visual Studio Team Explorer.

The source control repository can be seen by clicking the "Code" link on the top menu. From here, you can download files but not upload them.

TFS source control is easiest to use when you integrate it with Visual Studio. Open a solution in Visual Studio and select File | Source Control | Add Solution to Source Control

You may be prompted to add a TFS server. If so, use the URL ending in ".visualstudio.com" that you noted from above. (Fig. 3)

TFSvc3-AddServer[1]

Select the Team project to which this solution belongs (Fig. 4) and click the [Connect] button.cl

iTFSvc4-SourceControl[1]

From here you check-in, check-out, branch, merge, and get latest in the same way that you would use a TFS server within your enterprise.

Microsoft is adding new features to this Team Foundation Service each week. You can follow the progress on Brian Harry's blog at http://blogs.msdn.com/b/bharry/archive/tags/tfservice/.

Team Foundation Service allows you to manage projects on your own or with organizations that don't have the hardware and/or time to set up their own TFS server. It can be a simple solution to integrating your project with Application Lifecycle Management tools.

Agile | ALM | TFS | Visual Studio
Saturday, July 27, 2013 7:39:05 PM (GMT Daylight Time, UTC+01:00)
# Thursday, May 17, 2012

In October, the Great Lakes Area .NET User Group (GANG) celebrated 10 years this past October with an all-day event. Here is Godfrey Nolan’s presentation on Executable Requirements or BDD in .NET.

.Net | Agile | ALM | Video
Thursday, May 17, 2012 4:54:00 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, August 23, 2011
Tuesday, August 23, 2011 5:05:00 AM (GMT Daylight Time, UTC+01:00)
# Wednesday, February 24, 2010

Episode 74

Debbie Must describes the unique challenges of deploying her software and how she attacked these challenges.

Wednesday, February 24, 2010 4:51:27 PM (GMT Standard Time, UTC+00:00)
# Monday, February 15, 2010

Episode 71

In this interview, Tim Wingfield describes the Kanban system and how he uses it.

Monday, February 15, 2010 5:11:42 AM (GMT Standard Time, UTC+00:00)