DNN Blogs

Written for the Community, by the Community

The super simple guide to Github

Written By Tycho de Waard (SU)
2019-07-16

If you are not a coder by nature, Github is created by aliens. At first it makes no sense whatsoever. At a second glance it does not get better.
But I am Dutch, stubborn and determined to get involved. And I cracked this thing. And now I am able to explain to normal people how it works. I made every mistake, so you don't have to. Here is... *drum roll*... Github for non-devs.

Before we start

We need to align our thoughts. Why would you want to know how Github works? Well, there were (are) 2 things for me. First of all, sometimes there are tiny things that need to be changed. For instance, if an <H1> tag is missing in a template. That is important for SEO and with a tiny bit of HTML knowledge you can contribute. Second, there are some awesome super smart people and I rather see them put to good use. I mean, if there are only hotdogs in the kitchen, I'll heat them up myself. No need to hire a 3 star Michelin chef for that.

In this article I assume that you are willing to contribute and have a little bit of knowledge of at least HTML or CSS. 

What do you need?

  • A Github account
  • An editor to edit code: in the following examples I use Visual Studio Code
  • Something to manage the source code; in the following examples I use Github Desktop

The steps

  1. Go to the github repo where you want something to be changed. Make sure you are logged in.
  2. Click on 'fork' (top right of the screen)
  3. In your own fork, click on the green button 'clone or download'. It is important that you are in your own fork and not the original!
  4. Select the url (looks like https://github.com/Tychodewaard/DNNCommunityTheme.git) and copy that.
  5. Now go to Github desktop and choose File - Clone repository
  6. Choose the tab url, paste the url and (after selecting the right folder) choose clone
  7. Now it is making a copy of your fork to your local machine
  8. Click on 'open in Visual Studio Code
  9. Make the changes in Visual Studio Code
  10. CTRL-S (or Save)
  11. Now go to Github Desktop. Within a couple of seconds, it detects that you made changes (Yeah!)
  12. Now create a new branche (Top of you screen 'Branche - new branche)
  13. You can give it a name so you know what you did, like 3columnRow
  14. Github Desktop now proposes to move the changes to the new branche. Yes please!
  15. At the bottom left, there is a small box to commit your code to the branche. So, we do that. Give the commit a title and a short description and click on the 'commit button'
  16. Now Github Desktop asks if you want to create a pull request. Sure!
  17. Now, you're being redirected to Github where you'll find on the left the original master (the repo that you want to accept your code) and on the right your fork and the newly created branche. Just push the button and you're done.

Some more details that are nice to know

  • Use your own repo. The activity of your personal account counts on the https://dnncommunity.org/Community/Dashboard. The pull requests I created as a company are not being monitored so...0 points for that one
  • If a pull request is submitted, don't create changes and submit another pull request in the same branche (or master). Maybe it is possible, but all I got is mixing stuff up and the people accepting the pull requests got confused
  • If you mixed up stuff or Github is otherwise a pain in the butt, just delete the folder on your machine, delete the fork and start again, This takes 5 minutes while trying to fix things takes at least an hour without the desired result.
  • In line with this: create new branches. This is easier for you and the ones accepting your code.

 

Total: 2 Comment(s)
Great post, small note, most of what you do in github desktop can be done directly in Visual Studio Code git controls in the left pane too. That being said, nothing wrong with github desktop too.
Thursday, July 18, 2019 ·
I prefer doing everything in VS Code w/o GitHub Desktop in the middle. Maybe I need to try it again? Thank you for your third bullet under "nice to know" - I shared it with the staff here. We have each learned this the hard way more than once and its nice to see we are not alone!
Saturday, July 20, 2019 ·

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved