How to manage version control system with GitHub

Robert Theo
4 min readJul 4, 2024

--

Hans, Rangga, Dason, Ferry, Rizky, Robert (Me).

During my learning at Apple Developer Academy @Binus, I needed to collaborate with a teammate, but sometimes the collaboration did not work well by sending the project to each other in the team.

src

Introducing Git & GitHub

Git is a version control system that keeps track of file changes. It’s especially handy when multiple people are modifying the same files simultaneously.

GitHub is a cloud-based platform where you can store, share, and work with others to write code.

Why use GitHub?

By using GitHub it allows you to:

  1. Showcase or share your projects.
  2. Monitor and manage changes to your code over time.
  3. Allow others to review your code and provide improvement suggestions
  4. Collaborate on a shared project without the risk of your changes affecting your collaborators’ work until you’re ready to merge them.

How to Install

I’m using MacBook and I’ll try to explain how to install git on MacBook.

  1. Open the terminal and type “brew install git”.
  2. Wait until the installation is finished.
  3. Type “git version” in the terminal.
git version

Repository

A repository on GitHub, often called a “repo,” is a digital storage space where you can keep all the files and their history for your project.

How to create a new repository:

  1. make sure you already log in and access this URL https://github.com/new.
  2. Fill out the form and “Create repository”

Branch

A branch in GitHub is a parallel version of a repository, allowing you to work on different versions of a project simultaneously.

How to create a new branch?

  1. Click the “New branch”.
  2. Fill out the form and click “Create new branch”.

Commit

Commit in GitHub (and Git in general) is a snapshot of your project’s files at a specific point in time.

How to commit?

  1. Open terminal.
  2. Stage the changes by typing git add . .
  3. Commit the changes by typing git commit -m “your commit message" .

Push

Push in GitHub (and Git in general) is the process of uploading your local repository’s commits to a remote repository on GitHub.

How to push?

  1. Open terminal.
  2. Make sure you already stage all the changes.
  3. Type git push origin <branch-name> .
  4. Wait until finished, and congratulations you already do push.

Pull Request

Pull Request on GitHub is a feature that facilitates collaboration and code review by allowing developers to propose changes to a repository.

How to pull request?

  1. make sure you already log in.
  2. Make sure your changes are already committed and push.
  3. Open the GitHub URL repository and open the “Pull requests” menu.
  4. Click the new pull request.
  5. make sure which branch that you want to merge and then click “Create pull request”.
pull requests menu.
new pull request view.
list of pull requests.

Conclusion

Using Git and GitHub greatly enhances the collaboration and management of code, especially in team environments like the Apple Developer Academy @Binus. By implementing GitHub, teams can efficiently track changes, collaborate on shared projects, and review code without disrupting each other’s work.

Reference:

[1] https://docs.github.com/en/get-started
[2] https://github.com/robertheo15/Walme

--

--

Robert Theo
Robert Theo

No responses yet