Find a commit that broke something after a merge
Sometimes there is a need to find a commit that changed the project wrongly. This bad commit is difficult to find and hence consumes a lot of time. Git has introduced a method to find this commit which broke something after the merge:
git bisect start // starts the bisecting session
git bisect bad // marks the current revision as bad
git bisect good revision // marks the last known good revision
Now, git will automatically checkout a revision halfway between the known “good” and “bad” versions.
git bisect good // OR git bisect bad
Common Git Problems and Their Fixes
Git is a free and open-source version control system. These days git is being extensively used and therefore this article focuses on some of the common Git tricks that everybody at some point of time requires while working with git or Github.
Sometimes the user makes some mistakes while working on Git which results in the loss of information or wrong information being added. To overcome this problem, Git provides some methods/tricks to roll back or modify the changes that were made wrong or made by mistake. Some of these problems along with their fixes are listed below:
Table of Content
- 1. Edit a commit message
- 2. Undo the local commits
- 3. Reverting pushed commits
- 4. Avoid repeated merge conflicts
- 5. Find a commit that broke something after a merge
Contact Us