Categories
Git Programming Languages

How to Resolve Conflicts in Files and Push the code to Git

If you are facing some conflict issues in some file(s) during commit or merge then you can follow the below procedure to resolve conflicts. You don’t need mergetool for this. It can be resolved pretty easily manually. WinMerge is pretty good tool to resolve these kinds of conflict issues.

1. First see and identify which files are in conflict by using git status command.
2. Open each file in text editor and examine the difference and resolve them by removing the code that you don’t need. You may need to discuss it with fellow developers/designers who committed the code.
3. Once you’ve resolved the conflict in a file then use git add file_name_with_complete_path.
4. Once you’ve resolved all conflicts then use the command git commit -a -m “resolved conflict in files”
5. Now use the command git push origin YourBranchName to push your changes to Git repository.