Kevin Boston
2 min readJun 27, 2021

--

Git basics

The most important aspect of a software engineering role is improving on already existing code. How does one access a project already in motion? How do you track progress? Git is a popular answer to these problems.

Git is a version control system which allows users to view changes between versions, track which contributor made them, and see when the changes were made. The developer in question may also include a message explaining the changes. It is very important to have this information located in the same record, so a future developer can see the iterative logic from past development.

Git is organized by repository (or repo). Each repository has a file structure, a log of changes, and the option to create a branch. A branch occurs when a developer creates a separate copy of the files in the repository, often to test a new feature or fixing bugs, without jeopardizing the current, functional codebase. The new branch can be changed by the developer and could be potentially merged into the primary branch, conventionally called main. The iterative nature of repositories is made possible by a developer committing their changes to their particular branch of the repository. A commit contains changes to the files along with commit messages, explaining the changes.

Developers interface with Git via a client application or via the command line. As each application is different, I will discuss the most basic commands:

  • git init — creates the initial infrastructure for a git repository
  • git clone — creates a local copy of an existing project, including history and branches
  • git add — creates a version change. Adding is part of a 2-step process of synching to a remote repository. Adding allows the developer to specify which changes they want to send to the commit process.
  • git commit — actually saves a version of the changed files to the git history.
  • git merge — combines 2 separate branches into a single branch. This is typically done after a branch has been forked, developed, and tested.
  • git pull — updates local files with changes made remotely. If a teammate changed files you are also working on, it’s important to ensure you’re working off the same code.
  • git push — used to update a remote repository with local changes.

One of the most popular git providers is GitHub. Learn more about git and how to use GitHub, with their guide.

--

--