After trying VSO for a while, i thought i would try my hand at GitHub, finding the sync process for SSMS/VSO to be crippling on performance in my work environment. With that I have uploaded all my PowerShell and SQL Scripts there and will add links to download scripts instead of the occasional OneDrive download!

So lets get started. you want to source control your scripts.

Create a Repository from GitHub for Windows

Step 1: Create an account on GitHub I wont bother on the details there its pretty self explanatory.

Step 2: Download GitHub for Windows HERE install and login.

GitHib01

Step 3: Open GitHub you should have a icon on your desktop (Along with Git Shell as well)

GitHib02

Now open the + (Top left)

GitHib03

Step 4: We are making our first repository so click “Create”, give it a Name and choose your path. Ive left mine in its default location and called it Test Repo.

GitHib04

Step 5: Create a text and save it in the folder of the repository

GitHib05

You’ll now see that file show up in GitHub! now we need to commit the work, so fill in the Summary and Details and tick “Commit to master”

GitHib06

You will now see Changes has gone to 0 and we have unsynched now at 2 (1 to create the repo and 1 to add the file!)

GitHib07

Now we need to publish our repository, which is done by simply clicking the “Publish Repository” button and giving a detail

GitHib08

then click the little arrow under description to tell it which account to put it in.

GitHib09

After we have sync with the host. it shows 0 changes pending and 9 unsynched.

GitHib10

Clone a Repository from GitHub to my Local Client

Ok so we created a repo.. we uploaded all our files. we go home.. and want to access them! whats the steps.

Well its pretty much the same.

Step 1: Create an account on GitHub I wont bother on the details there its pretty self explanatory. You already did this!

Step 2: Download GitHub for Windows HERE again and login.

GitHib01

Step 3: Open GitHub you should have a icon on your desktop (Along with Git Shell as well)

GitHib02

Now open the + (Top left)

GitHib03

Step 4: This time we are just going to clone! After hitting the + button click Clone instead of Create this will then show you all your repos.

GitHib11

Select the repo you want to pull down (Im picking my Test-Repo again! as i really need that uber text file i created earlier!) and press the Clone <Name of Repository> button at the bottom

GitHib12

It will then ask where you want to put the directory. Im leaving it in the GitHub folder of Documents.

GitHib13

It will then sync with the host and bring down all your files! and sure enough! looking in folder location, there it is!

GitHib14

We can then look at the History should we be working with others.

GitHib15

I hope this has been helpful to you and please leave comments if you have any questions.

Advertisements