Today went to to get new changes from the Magento repo in the develop branch. I'm using phpstorm.

Commands I used

git remote add mageblob [email protected]:magento/magento2.git
git fetch mageblob
git checkout dev <= this is my local dev
git merge mageblob/develop

Merge process go aborting and suggest me remove files in dev/tests var/.htaccess v.v..
How to fix it.
p/s: Btw this is best way to pull all code changes from repos? i'm newbie in git

1 Answer 1


You have changes in local files. If you want to preserve local changes use:

git stash save
git merge mageblob/develop
git stash pop

see https://stackoverflow.com/questions/11675841/git-stash-merge-stashed-change-with-current-changes

If you don't need these changes just reset (be careful all non-committed changes will be lost):

git reset --hard
git merge mageblob/develop
  • Thanks for your response! which one is better when get latest code from remote repos? merge or pull
    – mrtuvn
    Nov 11, 2015 at 2:28
  • pull will perform a fetch and additionally merge or rebase the changes into your local branch depending on the configuration setting pull.rebase or branch.master.rebase. I use fetch and merge when I suspect non-fast-forward merge. And I use pull if my local code have no difference with same origin tree.
    – Alex
    Nov 11, 2015 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.