How to resolve git conflict or git merge issue using Intellij

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Biggest problem we face when multiple peoples are working on same project is merge conflict. If same file is edited by 2 people or more we get merge conflict and we need to resolve the conflict before pushing the code to github So in todays tutorial we will see how to best resolve merge conflict using intellij We have cloned a project from github into out intellij project Lets ignore the error. I haven't setup intellij in this machine. Its freshly installed Lets open the project Inside SRC -> main -> java -> com -> gourabpaul.web -> controller we will change the file HelloController So we change line 44 to Happy new year 2019. These part of code change in done by say person A1 And in github repo I will directly update it. To mock the actual scenerio. I will update the same file line 44 and add goodbye 2018. In actual project this part of code will be committed by another person say B2 We can write our commit message and description here. We will keep it blank We can use git plugin provided by intellij to push or pull the data. But as of now we will go with command script We will add the file Then we will commit the file to our local repository Till now we didnt face any issue. Once we pull or try to merge we will get error message Lets check. Git push. userid password So its rejected and asked to pull latest code from upstream as the head is different Lets pull the latest code. We can use the command promt but this time I will go with the ui plugin so that we can resolve the conflict in better way Here all the branches will appear and we can see what are files have merge conflict and on the right side we can see what changes to accept. But we will go deep insode and use merge tool and in the background we can see git merge has made some edit . Lets click merge So we can see it has opened a toolbar which shows the differnces Extreme left is the local changes made, centre 1 is the file where both local and remote were having common head And right 1 is the file present in remote i.e changes made by person B2 SO we need to update the file that is in the center. We can use these double arrow to take the changes or we can write or copy it manually Even we can take the remote changes or keep both changes and click apply Lets add and then commit it with message like resolved merge conflict Then git push to update the remote branch And it updated the master branch successfully. Lets cross check it Thats all for this tutorial Dont forget to hit Like button, share and subscribe to codespace. for any query Write in the below comment section
Info
Channel: CodeSpace
Views: 51,588
Rating: undefined out of 5
Keywords: resolve merge conflict, how to resolve merge conflict in vs code, solve git merge, git merge issue, git conflict, merge conflict, github tutorial, github pages tutorial, version control, repository, how to use github, version control tutorial, repository tutorial, how to get started with github, github version control, what is git, git commands, Handle Merge Conflicts, devops tools, devops tutorial, devops training, Git Merge Conflict, yt:cc=on, codeSpace
Id: OM-Wv9_qRDY
Channel Id: undefined
Length: 4min 10sec (250 seconds)
Published: Sun Jan 13 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.