/github-for-non-tech

How to understand what a commit is in GitHub?

Learn what a commit is in GitHub with clear steps to install Git, initialize a repo, make commits, push changes, and understand commit anatomy and best practices.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to understand what a commit is in GitHub?

 
Step 1: Install and configure Git
 

  • Download and install Git from the official website (https://git-scm.com).
  • Verify the installation by running the following command in your terminal or command prompt:

git --version
  • Set your identity so commits are attributed correctly:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

 
Step 2: Initialize a new Git repository
 

  • Create a new folder for your project and navigate into it:

mkdir my-github-project
cd my-github-project
  • Initialize an empty Git repository inside that folder:

git init
  • This creates a .git directory, where Git stores all versioning data.

 
Step 3: Make changes and stage them for commit
 

  • Create or modify a file. For example, create README.md with some content:

echo "# My GitHub Project" > README.md
  • See which files are untracked or have changes:

git status
  • Stage your changes so they’ll be included in the next commit:

git add README.md

 
Step 4: Create your first commit
 

  • Run the commit command with a descriptive message:

git commit -m "Add initial README with project title"
  • Git records a _commit_ object containing:
    • A unique SHA-1 hash identifying the commit.
    • Your author name and email.
    • The commit timestamp.
    • The snapshot of all staged files.
    • The commit message you provided.

 
Step 5: View your commit history locally
 

  • List all commits in the current branch:

git log
  • You’ll see output similar to:

commit 9fceb02d0ae598e95dc970b74767f19372d61af8
Author: Your Name <[email protected]>
Date:   Mon Apr 5 10:15:30 2021 -0400

Add initial README with project title

  • Press q to exit the log view.

 
Step 6: Push commits to GitHub
 

  • Create a new repository on GitHub (via the website) with no initial files.
  • Link your local repo to GitHub by adding a remote named origin:

git remote add origin https://github.com/your-username/your-repo.git
  • Push your commits to the main branch:

git push -u origin main

 
Step 7: Explore commits on GitHub’s web interface
 

  • Open your repository on GitHub.
  • Click the “Commits” link to see a list of all commits.
  • Each entry shows the SHA, author, date, and commit message.
  • Click a commit hash to view detailed changes (diff) for each file.

 
Step 8: Understand the anatomy of a commit
 

  • SHA-1 hash: Unique identifier for the commit.
  • Author Information: Who made the change.
  • Date and Timestamp: When the commit was created.
  • Commit Message: Human-readable description of the change.
  • Parent Commits: Link to previous commits (merges have multiple parents).
  • Tree Object: Snapshot of the project’s files at that moment.

 
Step 9: Best practices for writing commit messages
 

  • Keep the title line under 50 characters.
  • Start with a capital letter and use the imperative mood (e.g., “Fix bug” not “Fixed bug”).
  • Separate subject from body with a blank line.
  • Explain _what_ and _why_, not _how_.

 
Step 10: Further exploration
 

  • Use git show <SHA> to inspect a single commit in detail.
  • Experiment with branching and merging to see how commits combine.
  • Review GitHub’s “Insights” tab for network graphs and contribution history.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022