Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Eelco Verbrugge
Eelco Verbrugge

Posted on • Edited on

     

Solve merge conflicts with PHPStorm

Once in a while a merge conflict popups. This happens when you've created your branch and in the meantime your colleague pushed changes just before you did on the same line. Git (or your colleague) will let you know if it can be solved automatically and if not, it's up to you how to fix it.

How to fix merge conflicts with PHPStorm?

1. Checkout the branch where you want to merge to. For example themaster branch.

PHPStorm->Git->Branches...->master->checkout

2. Pull the latest changes to your local machine frommaster

PHPStorm->Git->Pull...->Pull

3. Checkoutyour_feature_branch where you've made your changes

PHPStorm->Git->Branches...->your_feature_branch->checkout

4. Also pull the latest changes to your local machine from your branch, just to be sure

PHPStorm->Git->Pull...->Pull

5. Mergemaster intoyour_feature_branch

PHPStorm->Git->Merge...->master

6. Resolve Conflicts

PHPStorm will automatically open this Conflict window if there is a conflict detected:

alt text

Choose Merge.

7. Accept or refuse solutions on the right or left.

alt text

Apply if done.

7. Git commit your changes

PHPStorm will automatically commit these changes if you Apply. Git will generate a comment for your commit such as "Merge branch 'development' into your_feature_branche"

8. Git push and celebrate life!

PHPStorm->Git->Push...

Thats all folks~

Source:
jetbrains.com

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I write about coding subjects in order to expand my knowledge and hopefully others. Learning is creation, not consumption.
  • Location
    The Netherlands
  • Joined

More fromEelco Verbrugge

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp