Welcome to GitHub – Your first git repository

I’ve been using GitHub for a while now as it’s a great way to share ideas and code in the public domain. Recently, I’ve had a number of people ask me how they can get started using GitHub. Thankfully, GitHub is an extremely simple service to use!!

Firstly, GitHub is a social coding repository, building on top of git (a source control system) to encourage collaboration on code and open source projects. By having this aim, the site is organised in such a way to make it very simple to upload code, as well as add additional contributors to the project. GitHub also has paid for accounts offering private repositories and additional features.

First, to use GitHub you need a git client installed. If you are on OSX, I recommend using the git-osx-installer while if you are on windows I suggest the MSysGit project. From my experience, I’ve found these to be the most effective way to start using git.

After signing up for a free account on GitHub, you need to create a public key. The next stage is to create a public repository to store code.

All you need to do is enter a name for a new repository, a description and click Create. Each project has it’s own repository, unlike with other source control systems such as SVN.

GitHub_Create.png

After clicking create, you have your repository. GitHub provides you with the next steps about how you can add code in your public repository. A great way to learn the fundamentals of git at the same time.

GitHub_ReproCreated.png

The first command you will need is ‘git init’, this creates your local repository to store your project. Once you have a local repository, you can do all the standard commands you would expect such as git add, git commit, branch etc.

After you push your code to github, everyone will be able to view, clone, fork your repository. A great way to allow others to collaborate on your project. In my case, the repository I created was http://github.com/BenHall/SimplyRubyServer/.

As you start using GitHub and Git more and more, you will really understand how powerful they are.

Leave a Reply

Your email address will not be published. Required fields are marked *