Getting Started with TortoiseGit & Github

Post written by Hudson Atwell
On Tuesday, September 23rd, 2014

What is a Git Repository?

Companies like BitBucket and GitHub offer code hosting solutions that help developers work on the same code base  through a version management system that detects and merges changes in a piecemeal fashion. This allows for each code change to have commentary and documentation through it’s author.

What are branches?

Within a git repository a code base can have multiple working versions of itself called branches. For example code developers could have a brand called ‘Development’ where they perform all code changes, and a branch called ‘Beta’ where they push code changes for user testing, and a branch called ‘master’ where the files are served to the public for consumption.

Most simple code projects keep one branch though and it’s called the ‘master’ branch by default.

What’s a fork?

If your repository is set to public then other users can clone your codebase into their own management. When this happens a fork is created. When a fork is created a connection between the clone repo and the original repo is created where changes made to the clone can be submitted back to the original repository.

This gives 3rd party developers such as your self the opportunity to improve code and have your improvements accepted by the original developers.

Further Reading:

http://programmers.stackexchange.com/questions/200663/why-do-people-fork-repositories-on-github

What is a merge?

From my experience a merge happens in two different contexts: 1) Incorporating changes made to a repository into your local codebase, and from your local codebase back to the repository.  2). Pushing changes made to a forked repository back into the original repository (also known as a merge request).

Sometimes code does not mix due to two developers making changes to the same parts of a code seperately. When that happens a merge conflict will occur and the developer experiencing the merge conflict will have to make the choice to use their version or the version that their version is in conflict with. Making this choice is called resolving a merge conflict.

GitHub

Github provides unlimited public repositories for free and is one of the top locations for hosting an open source project.  A monthly membership fee must be provided to host repositories privately. For us at InboundNow it is worth it to keep our code base management centralized.

https://github.com/pricing

BitBucket

Bitbucket on the other hand provides unlimited private repositories for free and requests a monthly fee to have public repos or add more than few team members to a private repo’s management team.

https://bitbucket.org/plans

TortiseGit – A Context Menu based Windows Client

TortiseGit is a Windows based git repository management client that is powered by the Windows (right click) context menu. This tool can be very handy for using the Windows UI to quickly execute commands to your git repository.

https://code.google.com/p/tortoisegit/

SourceTree – A UI based Windows Client

SourceTree is a UI assisted git repository management client and is great for quickly organizing and managing all your repositories from one location. It also helps visualize code changes differently as well as displays code base historic activity from all developers.

http://sourcetreeapp.com/

 

sourcetree

 

How to connect a git repository to your computer using TortiseGit

http://uncod.in/blog/github-tortoisegit-and-organizational-workflow-tutorial/

 

Forking a Repository, Connecting it Locally, Making Changes, Pushing Back, Creating a Merge Request.

Video Demonstration:

Smart Branching through SourceTree

I found this resource by sourcetree helpful is learning a branching system for development:

http://blog.sourcetreeapp.com/2012/08/01/smart-branching-with-sourcetree-and-git-flow/

About the Author:
Cheers! Hudson Atwell is a co-founder and the current CEO of Inbound Now. You can follow him on his Twitter at @atwellpub or request him for work on Codeable.io. Thanks for reading!

Posted in: Code

Continue Reading

Signup and get started with Inbound Now

Sign Up for Free

Download

[gravityform id="3" name="Popup Form" title="false" description="false" ajax="true"]