git TutorialIntroduction Installing Git Understanding Git architecture Initializing the new Git respository Cloning new Git repository .git directory in Git repository Viewing Git configuration First time Git configuration Using SSH keys with Git Checking Git status Adding files into staging area in Git Committing changes to the local repository Ignoring files using .gitignore Viewing the history of commits Viewing the file contents in working directory, staging area and repository Viewing difference between files Viewing the history of files Git revert Git Reset git reflog Creating and switching to new branches in Git Viewing existing branches Merging branches Resolving conflicts Rebase Deleting branches Renaming the branch in Git Push Pull Stashing the changes in Git Tags in Git Patches in Git Creating new repository on GitHub Pushing local repository to remote repository like GitHub IntelliJ IDEA
Resolving conflicts in gitWhen merging the branches, we often come across the conflicts. When same files are changes in both branches, conflicts occur.
Viewing the conflictsWhen merging the branch, we get error message saying there is conflict as shown below. We can also view the files that are in conflict using git status command. Below image shows that in both branches ( x and master), file f1.txt has been changed. To view the conflicts in specific file, use below command. Changes made in local copy are shown between
Changes made in other branch are shown between
<<<<<<< HEAD and =======.
After resolving the conflict, you have to add the files into staging area and commit the changes. When all conflicts are resolved and committed, merging process is finished. Here is the output of above example.
======= and >>>>>>>
Web development and Automation testing