Github Basics: Collaborative Version Control

Photo by Delaney Archer on Unsplash

What is Github?

Git Commands

It’s important to note the git commands are not in any particular order. I summarized them into three categories to reduce the complexities of each command’s objective. The complete list of all commands is located here, git’s documentation page.

Demo Project

Let’s start with the first step, Repository Creation; log in to Github and create a new repository.

For this blog, I will act as TWO entities and work off of TWO separate working directories; the first contributor will create the repo and work on the readme, then the second will pull the repo and work on the python file.

Contributor_1

Contributor_2

The first contributor has noticed the code prints the powers of 2 instead of printing a list of powers of 2. The first will need to edit off of the code-branch branch.

Contributor_1

It’s best practice to wait for the final merge after work is done in separate branches. To recap, CONTRIBUTOR_1 created the repo and worked on the readme off a readme-branch. CONTRIBUTOR_2 pulled the repo(both main and readme-branch) and worked on the python file off the code-branch. CONTRIBUTOR_1 created some edits on a secondary branch off of CONTRIBUTOR_2’s code-branch. To close, let’s let CONTRIBUTOR_2 merge to the main and push.

Contributor_2

Thank you for making it to the end! I hope this short demonstration has helped you work with git’s version control.

--

--

Hello! My name is Albert Um.

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