Git and GitHub
Conflict Resolution
In this module, we will learn how to handle and resolve conflicts in Git. Conflicts occur when Git cannot automatically merge changes made in different branches. It is crucial to know how to resolve these conflicts to maintain an efficient workflow.
What is a conflict?
A conflict in Git occurs when two branches have made changes to the same lines of a file or when a file has been deleted in one branch and modified in another. Git cannot automatically decide which changes to keep, so it requires manual intervention.
Detecting conflicts
During merge
When attempting to merge a branch, Git may encounter conflicts. For example:
bash
Git will attempt to automatically merge the changes, but if it finds conflicts, it will display a message indicating that there are conflicts that need to be resolved.
Viewing conflicts
When there are conflicts, Git marks the conflicting file with the following tags:
bash
- Introduction to Git and GitHub
- Installation and Configuration of Git
- Version Control Fundamentals
- Repository Creation and Cloning
- Making Commits and Tracking Changes
- Branch Management (branching)
- Branch Merging (Merging)
- Conflict Resolution
- Collaborative Work on GitHub
- Pull Requests and Code Reviews
- Advanced Git Usage (rebase, cherry-pick, etc.)
- Automation with Git hooks
- Continuous Integration with GitHub Actions
- Version Management and Release Deployment
- Conclusions and Best Practices in Git and GitHub