Managing Source Code with Git, GitHub & Vim

Fatima Abdullahi
4 min readApr 3, 2023

--

Firstly,

What is GitHub and what are its benefits?

It is a web-based platform for version control and collaboration. Developers can store and manage their code repositories on GitHub. It offers a platform for developers to share, work together on, and contribute to either their own private or open-source projects.

What is Vim?

Vim stands for “Vi IMproved”, it is an open-source text editor with a command-line interface that is very configurable and versatile.

Requirements

A CentOS 7/8 Linux system with basic Linux command line knowledge

A GitHub account

Basic understanding of Vim

Sudo privileges

Part 1 Fork the Level Up In Tech Repo Here: https://github.com/LevelUpInTech/LevelUpTeam

In order to do that you must complete the following:

Install Vim and Git on your CentOS 7/8 system by ensuring that the CentOS 7/8 server you are using is running and that you are logged in through ssh. Then you implement the following commands to install Vim and Git:

To install vim sudo yum -y install vim

To install git sudo yum -y -install git

( Fun fact when to want to make a command look grey and similar to a code click the button underneath your Esc button on the keyboard and type)

Now we will begin to fork

Clicking the link given above will transport you to GitHub. Next, you can navigate to the top right corner of your screen, and you can access the LevelUpInTech repository.

To copy the repository into your GitHub account, click the “Fork” button as shown.

Part 2 Cloning the forked repo to your ACG cloud server environment

Acquire the https address of our forked repository, select the “Code” button, followed by the “Local” tab. Once the address is copied clone the repository from our GitHub account onto your CentOS 7/8 system. Use the command

git clone (http address)

The brackets are crucial. I made the error of not including the brackets and that seems to not work. The step we just did creates a new directory.

To make sure I went to the LevelUpInTech directory by changing directories then I typed ls to list all the files there.

Part 3 of the task is to create a change to the linux.sh file that is in the repository directory using Vim

Access the Vim editor through your terminal and alter the linux.sh file using the command

vim linux.sh

Part 4 save the file and add it to your local repo, then commit the file

Use the command below to add the modified file to our local repository.

git add linux.sh

To commit the changes

git commit -m "modified linux.sh file with new commands”

Part 5 Push the file back to your own GitHub repo

When I tried to make a personalized token with Github before pushing I got an error so in order to fix that I went to settings then developer settings then I clicked create token. Using the token you get you are able to generate in place of our password when you try to push. Once done we can move on to our final part.

Part 6 Send a pull request to merge with Level Up In Tech production repository

Lastly, return to GitHub to push the branches and merge by creating a pull request. Do not forget to select your head repository and the correct base repository.

We did it! In this guide I showed you a step-by-step guide on forking and cloning repositories, editing files with Vim, staging, and committing changes. In addition, we learned how to push and pull within repositories in GitHub!

Steps from LevelUpInTech!

#LevelUpInTech

--

--

Fatima Abdullahi

Currently studying with LevelUpInTech and excited to see what cloud computing has in store.