If you’re using R at work, you should check my latest project called productive R workflow!
It’s an elixir of all the best tips and tricks I know. I'm launching the project next week meaning the price is currently exceptionally low!
👋Good morning!
I know that this newsletter typically focuses on Dataviz. But this issue will lean more towards programming. 🙈
However, I'm aware that many of you likely use code to create your charts, and it's probable that your code is just stored on your laptop, which presents four potential problems:
🔥 Safety: if your laptop dies, you loose your world
✉️ Sharing: you know this feeling when you send your work by email and it’s outdated 10 seconds later?
🦕 History: wouldn’t it be great to be able to go back in time to see something you tried 15 days ago?
🤝 Collaboration: your boss made a change on the script. So did you. That’s gonna be a mess!
Great news! Fortunately, there's a solution for all of these challenges: GitHub.
This issue will teach you how to use Github in just 10 minutes. If you’re already familiar, share this with your friends!
1️⃣ What is GitHub?
Github is an online platform for hosting code. It's a website where you basically duplicate your work.
Github is not a little niche tool. It’s used by millions of ppl for free.
When a work folder is duplicated on Github, we call it a repository.
My Github profile looks as below. You can find everything I’ve ever been working on!
➡️ Now is a good time to create your account here!
2️⃣ Synchronisation
Your work folder is going to be duplicated. We need a way to synchronise what's on your computer with what's on the cloud (Github).
We're going to do this with a tool called GitHub Desktop. It's time to install it from there.
Once installed, use the Sign In button to link it with your GitHub account!
3️⃣ Publish
It’s time to publish your first repo to Github.
Do File ➡️ Add local repo ➡️ Choose ➡️ Select a folder you are working on.
Click the big blue Publish Repository button.
Check your Github profile page. Your work is now online! 🔥
4️⃣ Commit
With Github Desktop you create 'Steps' in your work.
Those steps are called commits.
Change something on a file of your folder.
GitHub Desktop will update and show you the change
Give it a name and press "Commit”
➡️ That's your first commit!
This is huge, because thanks to Github it will be possible to go back in time to any of those commit you’ve made!!
5️⃣ Push
Those changes are made locally only for now.
It is time to send them to the cloud thanks to the push button.
Check your repo on Github!
It's now updated with your changes!
Share it with the world! It’s much more convenient than sending it by email isn't it?
That’s it!
Your code is now safe, you can track its history, and people can easily read it and suggest improvements 🎉
Github is intimidating at first. But the basic usage I just described is straightforward!
Give it a go and there will be no coming back. To be honest I could not live without it.
If you found this introduction helpful, you'll love the final module of my Productive R Workflow project. It covers this topic in greater detail and offers even more valuable insights!
Have a good day!
Yan