Simply – How To Use GitHub

I am not sure why but I struggled with understanding how to use GitHub when I started out. It seems almost silly now.

I think one of the most important things is to understand the concept of git and why it is so useful.

Git is a version control system.

Simply put, it allows you to have access to multiple versions of a file as you save it throughout it’s lifetime.

For instance, say you have a file, you make changes it it and save the file to a specified location. You return to work on it a few days later, but this time you want to remove something and replace that data with something else. A few days on from this event, you realize that you needed the data that you had deleted, but you had save over your file so that data has been permanently overwritten.

This is also why we end up saving things like this:

Filename1 > Filename2 > Filename3 > Filename4

You either end up with a folder like this:

> MyFolder
     > Filename1
     > Filename2
     > Filename3
     > Filename4

Or you would have a single file that you would overwrite to each time you save your changes:

> MyFolder
     > Filename

Either way there are negatives to both approaches:

  • You can waste a lot of time sifting through your changes as there’s no easy way to find out the previous changes unless with a scripting language. If you have overwritten your file, it’s even more difficult to retrieve that information.
  • The first approach would mean you end up using a lot of disk space than anticipated. I would imagine that you’d also need to have a separate way to track version control, otherwise you could get lost in the version numbers that you append to the end of the file.

As a version control system, Git keeps revisions straight, modifications are stored in a central repository.

Benefits of Git:

  • Easy access for team working on the same project off the same files
  • Persons involved in the project can contribute to the same repository and commit their changes.

GitHub is a central repository that can be made public or private. It can be shared with anyone and allow contributions. It is also commonly used as an additional tool to Resume/CVs as employers can see the work you have contributed to other projects as well as your own.

Getting started with GitHub – create your own repository:

Step 1 – Download GitHub

Step 2 – Go to File > New repository > give your repository a name

new-repository

This is a contrived example, but let’s say you create a project where you will store your source files:

project1-git

Once you make new changes to your project folder, GitHub will automatically detect the changes and ‘Push origin’ will appear on the top right which allows you to push your changes to GitHub. When you do this, GitHub will notify you if there are any clashes in modifications by different people to the same files. It will then give you the opportunity to review the changes and select the correct changes to commit to the repository.

push

I like to view my files directly within the repository. Note I am using GitHub to track changes on my personal projects. You may wish to use Git Bash to commit your changes without using a UI.

open-rep


Did you find this useful? Let me know below.

Advertisements

How to Join By Columns in SQL to Solve a Problem

Most people will be familiar with the following types of joins:

sqljoins.jpg

That’s why when someone throws a curve-ball and asks you a question which requires a join of two tables in a SELECT query you get stumped because there’s no primary-foreign key relationship.

I learnt the hard way, but in hindsight, I can’t believe I didn’t get it. I remember learning about it…once upon a time.

Read More »

How can I automate information gathering using Powershell? – Part 2

I have been bouncing in between learning powershell and SQL Server. At some point I’ll have to choose one sole thing to focus on (or so the gurus advise). However 2 is better than 20 projects at a time! I’ve come to realize that by simplifying my work load I become much more productive, it is just about finding that balance.

I have actually been working on this project, even though I said I parked it slightly in my previous blog post. Excited to say it is at least looking a lot more like a usable script. It is also returning some pretty useful information…at least in the perspective of our company!

Read More »

How can I automate information gathering using Powershell? – Part 1

After SQLBits I got inspired to get stuck into some personal projects. These ideas have been bouncing around for a while. I parked it because I always imagined it would be a mammoth task. I usually over-complicate things when I think about it for too long. After such an inspirational couple of weeks I’ve decided to take further action on my projects.

The Idea

So I have been working in roles which involve solving technical problems. I have noticed that the same type of questions crop up during the information gathering stage.

My thought is, can we do this quicker?

Read More »

169 Words to Summarize ‘The Microsoft Modern Data Warehouse’

So if you know me you are probably aware that I am studying for my Data Warehousing exam, I have an extensive list of exams which I am doing. Why exams? I have personally found that I have developed so much more by doing them, the pros have outweighed the cons for me in terms of speed and depth of learning. In the process of learning I am adopting and using many different sources of information.

I am also covering what I have learnt already because I value what I have learnt and I want to be able to bring theory into the practical workplace. I will continue to experiment with what I have learnt and provide my thoughts here. Mostly for myself really.

Read More »

Unable to access SQL Server Management Studio using the DAC (Dedicated Administrator Connection)

Problem

Unable to access SQL Server Management Studio using the DAC (Dedicated Administrator Connection)

Firstly, why would you need it?

TechNet states that the DAC allows an administrator to access a running instance of SQL Server Database Engine to troubleshoot problems on the server—even when the server is unresponsive to other client connections.

It basically is a ‘secret’ back door connection. SQL Server keeps a single thread processor resource available just in case the situation should occur where you’re locked out. Read more about it here.

I have literally heard at least 3 DBAs mention that at some point in their careers, this account has saved their butt.

So I thought I would investigate…

Read More »