Git Basics

This guide will go over some basic Git concepts you’ll use in Coalesce.

The main functions of Git you’ll use are:

  • Repository
  • Stage
  • Commit and Push
  • Branch and Merge

Repository

A repository is where you keep your code. There are two types:

  • Local - On your computer and typically not accessible by others.
  • Remote - A shared repository where others will contribute work. Such as GitHub or GitLab.

A typical workflow will mean a central remote repository that you have cloned locally. You make your changes locally then push them to the remote repository to contribute to the overall code.

In Coalesce, when you create a project, you’ll need to provide a URL to the remote repository so Coalesce can keep it updated with the changes you make.


Stage

Stage means you’ve selected which changes you want to go into your next commit. Selecting your changes in the Git Modal means you’re staging your changes.

The QA-STG_SUPPLIER.yml file is staged and will be committed, while the data.yml is not staged and won’t be committed.

The QA-STG_SUPPLIER.yml file is staged and will be committed, while the data.yml is not staged and won’t be committed.

Commit and Push

In Coalesce, we run your commit and push at the same time.

Commit means you take a record or “snapshot” of your local repository at that time. When making a commit, a commit message describes the changes made. It’s required in Coalesce to make a push.

Push means taking the local commits you made and sending them to your remote repository. The remote repository is the central location where all code and changes are stored.

When you click Commit and Push, Coalesce runs both of these at the same time.

Branches and Merge

Branches are where you’ll do your work. Typically you’ll create a branch off the main or feature branch. A branch contains changes made. A branch can be local or remote. A good workflow is to periodically commit and push your local changes to your remote branches. Then once you’re ready, merge your branch into the main feature branch.

Merge means adding your branch changes into another branch. Typically you’ll merge into the main branch.