Reputation: 1
I have a merge conflict and know the conflict but confuse as to how to fix it.
<<<<<<< HEAD
orm_adapter (0.5.0)
=======
arser (2.3.1.4)
ast (~> 2.2)
>>>>>>> master
<<<<<<< HEAD
warden (1.2.6)
rack (>= 1.0)
=======
unicode-display_width (1.1.1)
>>>>>>> master
Do I just add the conflict gem into gem file?
Upvotes: 0
Views: 1484
Reputation: 12906
You do not want to delete your Gemfile.lock. What you should do is reset the lock file and then bundle again.
git checkout Gemfile.lock
bundle
If you delete the lock file and bundle, you are most likely going to upgrade a lot of gems in your app. Even if you have done a good job of pessimistic versioning, you'll still upgrade patch versions, which is something you don't want to do just because of a merge conflict.
Also, regarding the thought of not adding the lock file to git, do not do that. Doing so would lead to each developer having a different set of gem versions installed on their development machine. Additionally, it would lead to your servers having different gem versions installed than what you are developing against.
All this is doing is resetting the lock file to its state before any changes were made to the Gemfile
. Running bundle will add (to the lock file) whatever gem was added to the Gemfile
. However, it will not change any other gems in the lock file. If you delete the lock file, it will generate a completely new lock file based off the Gemfile
, which will have the most current gem versions allowed (current unless there was any versioning in the Gemfile).
Upvotes: 1