
How to resolve git conflict or git merge issue using Intellij
How to resolve git conflict or git merge issue using Intellij
Git conflict is a common scenario arises when multiple people changes the same file. This video is how to overcome such scenarios and fix merge issue using Intellij
Resolve git using VS code : • How to resolve merge conflict using V…
------------------------------------------------
Follow me on:
►Youtube : https://bit.ly/2W1X7zz
►Facebook : https://www.facebook.com/e.codespace
►LinkedIn : https://www.linkedin.com/in/gourabpaul
►Twitter : https://twitter.com/gourab_p
-----------------------------------------------
#git #gitMerge
Content
0.31 -> Biggest problem we face when multiple peoples
are working on same project is merge conflict.
6.16 -> If same file is edited by 2 people or more
we get merge conflict and we need to resolve
11.56 -> the conflict before pushing the code to github
14.96 -> So in todays tutorial we will see how to best
resolve merge conflict using intellij
26.339 -> We have cloned a project from github into
out intellij project
32.88 -> Lets ignore the error.
34.37 -> I haven't setup intellij in this machine.
36.98 -> Its freshly installed
39.36 -> Lets open the project
Inside SRC -> main -> java -> com -> gourabpaul.web
49.75 -> -> controller
we will change the file HelloController
62.53 -> So we change line 44 to Happy new year 2019.
68.34 -> These part of code change in done by say person
A1
73.869 -> And in github repo I will directly update
it.
76.92 -> To mock the actual scenerio.
79.18 -> I will update the same file line 44 and add
goodbye 2018.
88.159 -> In actual project this part of code will be
committed by another person say B2
94.68 -> We can write our commit message and description
here.
97.71 -> We will keep it blank
104.189 -> We can use git plugin provided by intellij
to push or pull the data.
109.35 -> But as of now we will go with command script
We will add the file
115.569 -> Then we will commit the file to our local
repository
118.219 -> Till now we didnt face any issue.
125.609 -> Once we pull or try to merge we will get error
message
129.959 -> Lets check.
131.91 -> Git push.
133.65 -> userid
password
137.14 -> So its rejected and asked to pull latest code
from upstream as the head is different
143.93 -> Lets pull the latest code.
146.459 -> We can use the command promt but this time
I will go with the ui plugin so that we can
151.26 -> resolve the conflict in better way
Here all the branches will appear
162.92 -> and we can see what are files have merge conflict
and on the right side we can see what changes
169.01 -> to accept.
170.129 -> But we will go deep insode and use merge tool
and in the background we can see git merge
177.53 -> has made some edit . Lets click merge
181.91 -> So we can see it has opened a toolbar which
shows the differnces
186.34 -> Extreme left is the local changes made, centre
1 is the file where both local and remote
191.959 -> were having common head
And right 1 is the file present in remote
197.49 -> i.e changes made by person B2
204.87 -> SO we need to update the file that is in the
center.
208.55 -> We can use these double arrow to take the
changes or we can write or copy it manually
214.53 -> Even we can take the remote changes or keep
both changes and click apply
220.459 -> Lets add
and then commit it with message like resolved
224.019 -> merge conflict
227.67 -> Then git push to update the remote branch
And it updated the master branch successfully.
235.06 -> Lets cross check it
239.939 -> Thats all for this tutorial
Dont forget to hit Like button, share and
243.98 -> subscribe to codespace.
for any query Write in the below comment section
Source: https://www.youtube.com/watch?v=OM-Wv9_qRDY