DEV Community

Cover image for Git Terminology - It's All Connected
Cree
Cree

Posted on

Git Terminology - It's All Connected

Git Terminology

Git has some fancy jargon that everyone uses, but what does it all mean and how does it connect? Let's break it down into layman's terms! πŸ‘¨β€πŸ«

Change

Git keeps track of all of the files in a project. Whenever you make a change to a file, git knows precisely what you've changed and keeps track of it.

Commit

A commit is a collection of changes. Whenever you make a commit you are telling git that you'd like it to save all of the changes that you've made.

Branch

A branch is just a sequence of commits, so all of the changes you've made starting from the beginning of the project.

Whenever you branch you split off from the commit you are at currently. Other branches don't keep track of the commits you make on a separate branch, this allows you to make changes without stepping on anyone else's toes!

Repository

A repository, also known as a repo, is a collection of branches. It is the entire project, every commit on every branch.

Remote

A remote is a repository that isn't the one you are in currently. You can link to a remote to push and pull from it.

Push

When you push, you upload your commits from a branch on your computer to a remote repository's branch

Pull

When you pull, you download the commits from a remote repository's branch to a repository on your computer's branch.

Merge

Merging is when you synchronize the commits of two branches.

A merge conflict is when two commits change the same thing!

πŸ™ GitHub

GitHub is a website that hosts remote repositories!

Clone

A clone is a copy of a remote repository. If you don't have permissions, you cannot push changes to the remote.

Fork

A fork is a clone of a repository on Github under your name. You can push changes to your forked repository!

Top comments (2)

Collapse
 
sn0n profile image
Rob Foraker

And how do you manage merge conflicts or choose what to merge when and how? What if there are 10 push (or is it pull?) requests and you have no idea where to start? I know of diff, but never used it aside from debugging some compiler issues (which was mostly googling) when using make on Linux..

Collapse
 
jessekphillips profile image
Jesse Phillips

With a merge conflict you must understand the purpose of both changes and identify how to achieve them both. For me this a lot of times means tracking down the commits from both changes to get the context.