/github-for-non-tech

How to check if a GitHub commit broke the app?

Find out how to use git bisect to identify broken commits on GitHub. Follow our step-by-step guide to test, troubleshoot, and fix app issues efficiently.

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 check if a GitHub commit broke the app?

 
Step 1: Clone the repository
 

  • Open your terminal or command prompt.
  • Navigate to the directory where you want to store the project.
git clone https://github.com/your-username/your-repo.git
cd your-repo

 
Step 2: Ensure you’re on the correct branch
 

  • List all branches to confirm the main branch name.
  • Check out the main or development branch where you suspect the breaking commit resides.
git branch -a
git checkout main
git pull origin main

 
Step 3: Install dependencies and build the app
 

  • Install project dependencies according to your stack (npm, yarn, pip, etc.).
  • Build or start the app to ensure it runs before exploring commits.
# example for a Node.js app
npm install
npm run build
npm start

 
Step 4: Run your test suite manually
 

  • If you have automated tests, run them locally first.
  • Note any test failures or errors in the console.
# example using Jest for JavaScript
npm test

# or for Python projects
pytest

 
Step 5: Use git bisect to pinpoint the bad commit
 

  • Start the bisect session, marking the current (bad) state and a known good state.
  • Git will check out a commit in the middle; test your app there.
git bisect start
git bisect bad             # mark the current commit as bad
git bisect good v1.2.3     # replace v1.2.3 with a known good tag or commit

 
Step 6: Test each bisect step
 

  • After each checkout, build and test the app:
npm install
npm test
  • If tests fail or the app breaks, mark it bad; otherwise mark it good.
# when broken
git bisect bad

# when working
git bisect good

 
Step 7: Review the result and identify the culprit
 

  • Once bisect completes, Git prints the problematic commit hash and message.
  • Inspect the diff to understand what change broke your app.
# git will output something like:
# abc1234 is the first bad commit
git show abc1234

 
Step 8: Fix, revert, or patch the broken commit
 

  • Decide whether to create a fix on top of the bad commit or revert it entirely.
  • Implement your fix, run tests again, and commit your changes.
# to revert
git revert abc1234

# to patch manually
# edit files to fix the bug
git add .
git commit -m "Fix broken feature introduced in abc1234"

 
Step 9: End the bisect session
 

  • Once you have resolved the issue, stop git bisect to return to your branch head.
git bisect reset

 
Step 10: Push your fixes and create a pull request
 

  • Push your fixed or reverted changes to your remote repository.
  • Open a Pull Request on GitHub, explaining what commit was broken and how you fixed it.
git push origin main
# then on GitHub, click "Compare & pull request"

 
Conclusion
 

  • You’ve learned how to use git bisect alongside local testing to identify exactly which commit broke your app.
  • With this workflow, you can efficiently pinpoint regressions and maintain a stable codebase.

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