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.

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.

By Vaseem Ansari

Hey guys this is Vaseem Ansari, 27 years old, Software & Web Developer, Blogger & works on Wordpress Plugin Themes Development, PHP MySql Programming and Open Sources Technologies.
It takes a while for me to build trust in someone new. I am honest, thoughtful. I'm Glad I'm Me No one looks The way I do. No one walks the way I walk. No one talks the way I talk. I am me. There's no one else I'd rather be! Have fun reading this blog and don't forget to subscribe to the feed to keep updated on the latest articles.

Leave a Reply

Your email address will not be published. Required fields are marked *