Day 22: Git Zero To Hero ๐
Table of contents
Git Conflict
When u try to make same changes in a file with 2 different branches is known as Git Conflict as the name suggests there is some conflict ๐.
Let's say we have created 2 different branches b1 and b2 from master branch.
git checkout -b b1
and then by running the above command we moved into branch b1 and have changed the heading
Then move back to the master branch and create another branch b2
git checkout -b b2
and then by running the above command we moved into branch b2 and changed the heading same changes by b1 which will create a merge conflict
Now, let's merge b1 into b2 by staying in b2
as u can see we are not able to merge because of git conflict.
Resolving Conflicts ...
After failed merge operation git will give us something like this in VS CODE ...
Accept Current changes <<<<<, incoming changes >>>>> or accept both, select any one of these and then do git commit -a -m "merged".
Finally after doing all these have successfully merged b1 into b2.
The above image clarifies all thing .... woalaaaaa ๐
Next Blog Teaser ๐
Rebase ๐คฉ
Thanks for reading ๐๐งก