Why this post?
I know, I know! You’re thinking: “It’s 2015!! Who doesn’t know how to work with github?”
But unfortunately, I still find myself talking with my developer friends and see them talking about the new widget or plugin they developed for some framework they use and I always ask:
“Wow that seems really nice, are you thinking about sharing that on github or something?”
And almost always I get the same response:
“Hum no, I don’t usually do that…” or worst, “I never used github…”
How? And why? Since it only takes 4, very simple steps, to share your code on gihub.
So, now that i took that out of my chest, let’s create our first github repository!
Step 2: Choose a name for your repository (and optionally a description) and click on “Create repository”.Step 3: Now that your repository was created, it’s time to push your code to it. Github already gives you the commands to do that, you just need to follow them! How awesome and easy is that?
So if you already are using git to do version control on your computer (and you should!) you just need to add the remote path to the origin and push to it. If not, you just need to init the git repository and commit the files before you can do that.Step 4 (Optional): This step is about creating a README file containing information about your code. This is not required, but is highly recommended since you are sharing your code with others. This file together with some comments in your code can be a huge help to other people that want to use your code.
To create this README file, github has a special markdown that allows you to create headers, highlight code, and so on. You can check it here.
Also, to help you with that, I leave here a tool called dillinger were you can check some markdown examples, create your own README, preview it and export it.
After that, you just need to commit it to your project and you are ready to go!
Happy sharing 😉