GitHub Crash Course

By Rory Monaghan

SHARE

Recently I added the App-V 4.x and App-V 5.x recipes to GitHub as covered in my previous blog post. The great thing about this is that it allows for the App-V community to collaborate on this list. Together we can ensure there’s one well managed space online for App-V recipes. I went ahead and split these out to App-V 4.x recipes, which you can view here and App-V 5.x recipes, which you can view here.

If you have never used GitHub before (and don’t worry, I’m still very new to this myself!) maybe you have used a product like SharePoint. It’s a somewhat similar concept only GitHub provides a much better workflow for development and collaboration than SharePoint, it’s also free! GitHub is super popular for open source collaboration projects.

I have been asked by some people online how to update using GitHub. The answers is: there’s a few different ways. Let’s start with the easiest and most straight forward. In this example, I will add a new recipe into our App-V 5.x list.

I begin by browsing to: https://github.com/Rorymon/appvrecipes

Step1

When there, I click on my appv5recipes.md file.

An md file is for Markdown. Markdown is a lightweight markup language. The syntax is really simple and it’s supported by GitHub Pages.

Step2

You should see the list, click on the Edit icon.

Step3

Find the best place to enter your recipe. Please try to keep it in alphabetical order.  You can just copy an existing example in the text, paste it into the appropriate line, modify accordingly…

Step4

And when ready, add a short description of the change in the first textbox and a more complete description in the large textbox.

This part is very important: Select Create a new branch for this commit and start a pull request you can really name it anything you like and then click Propose file change.

This is going to create a new separate branch and send it to me for review. I can make sure the syntax is correct and that the link is good e.g. The site resolves, it’s not a duplicate, it’s in the correct recipe list, it’s in the correct alphabetical order and the information is complete. Then I will approve\accept the changes and merge it with the master branch, which will replicate to the site. For a cool illustration of branching in GitHub, check out this sweet demo.

Step5

The last step for you, is to just proceed to click Create pull request. Before doing so, you can review the change in the bottom section of the window, as you can see in the above example the one line I changed is highlighted in green, we can also see it’s showing just 1 addition. This pull request is what alerts me that the change is ready to review.

Step6

Once I am alerted, I will see your request, review and approve.

Step7

And walla, the site it updated.

If you notice that you cannot see the new entry on the site, you may want to close the browser and re-open. I read online that these GitHub Pages sometimes get hung up in the browser cache. If that doesn’t work, you may need to clear the cache. I haven’t had to do that yet.

So, that’s the easiest way, in my opinion. Most techies don’t use the WebUI, they go for commands! You could also download GitHub Desktop and use the Git Shell.

Examples of commands include:

cd C:\Users\<Name>\Documents\GitHub

git clone https://github.com/MadeUpHub/MadeUpRepo.git

This will bring down a copy of our MadeUpRepo repository to a GitHub folder in your Documents directory.

cd C:\Users\<Name>\Documents\GitHub\MadeUpRepo

git pull

Doing this at any time will perform a pull from the master repository to bring down any and all of the latest updates. This ensures any amendments you make are always on top of the latest code\data. And don’t worry, if you try to push work and somebody else updated while you were doing your thing, it’s ok. GitHub will see that and warn you that a change was made and you should first do a pull to make your update to the latest code\data.

git add .

Adds a local repository on your system. You should do this after making any changes you wish to push.

git commit -m “short description of change”

Commits the changes and populates the short description which will be visible on the WebUI.

git push origin master

That was a simple workflow example. It will push what’s in your local repo back to the master. Not covered was checking out, creating a branch and pushing back as a branch, which is likely what you’ll do unless it’s a straight forward project in which you can push your own updates without needing to go through change control. To learn more about the commands, check out this reference guide.

Watch

 

By the way, on GitHub you can watch repos and get alerted of any changes AND you can follow GitHub contributors (Go to their profile, you will see a follow button). By using the Fork option, it basically takes a copy of a repo and places it in your own.

Let's make virtualization easier!

Be amongst the first to know when I publish new reviews, guides and tools to simplify your projects.

By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.