Github for Research: a quick and painless tutorial to improve your papers


What is Git for?

The main use of Git is for version control. Version control is useful if you make any changes down the line that ruin your code, or that you later deem unnecessary, it allows you to easily revert things back to a working version.

How do I get started?

Now, there are many options of platforms out there, like Github, GitLab, Bitbucket, and so on. I will show you how things work for Github, but mostly the interface will change if you pick a different one.

Creating a new repository
Cloning your repository
Code to be added to the repository
Commands in the GitBash
Code in the Github repository
Added input to the function
All commits from this file

Maintaining your repository

Now, this is where a lot of people make a mistake. Let’s say you are done with the first part of this project and will work on something else, despite still related to the topic. The code you committed is the latest version of your code and you would like to keep it that way, maybe because other people might use it later, maybe it is referenced in one of your papers, or most importantly, you don’t know how your new changes will affect the code and want to have a stable version there.

New code to be added, note that our function has a new name and handles things slightly differently.
Changing out current code to the older one in the master branch

What else can you do?

There is still a lot more about Git. Here are some points you can explore:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store