By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Git Basics

Published:
June 24, 2021
Updated:
September 7, 2021

When just starting out it might seem that using a system like git is overwhelming on top of everything else you have to learn. Even though it might seem like it’s slowing you down it really is just preparing you for the eventuality of working in a team environment and is something that is definitely going to come up during interviews and jobs

Learn the basics first

  • Cloning — initial act of taking the repository from your git source to your local computer
  • Pulling — taking the changes from the remote (git source) repository is updating your local repository
  • Committing — This is an action that ties the current changes you’ve made in your local repository to a ‘commit’ object that you are able to label/message with references to the changes you’ve made
  • Pushing — Taking all your local commits and transferring them (pushing them) to the git source repository
  • Fetching — Updating your local git file with the current updates that are on the git repository (origin)
  • Branches — A system where you can create ‘branches’ that are essentially copies of your repository. This allows you to develop code ‘risk-free’ without touching what is referred to as ‘master’ (master-copy). Usually branches are used for feature development, and best practice is to create a branch for each feature and once that feature i complete to close that branch
  • Merges — This is a system in place to handle taking your current branch and merging it into another one (usually a master copy or a pre-defined integration branch). The trick here is to avoid working on the same portions of code in different branches as the merge will create a conflict that you will have to manually resolve

These core concepts make up most of the functionality you’ll need to know to at least have a good base and be able to integrate easily into any companies workflow. And to start learning them you can sign up for a free account on BitBucket or GitHub and start messing around.

Sometimes learning specific workflow habits can pigeon hole you as almost every company has a different workflow and if you don’t understand the basic concepts it’ll be tougher to go from one workflow to another.

To check out a example of a Git workflow that we have just started to use you can listen to our latest HTML All The Things podcast episode: Git Workflow!

Connect With Us

Twitter | Facebook | Instagram | YouTube | Patreon | Podcast

More to Read...