How do I resolve git saying “Commit your changes or stash them before you can merge”?

Zarshed Ali
Zarshed Ali
| 2 1 2
Asked on 1/9/15, 6:30 AM

You can not merge with local modifications. Git protects you from losing important changes. You have three options.

One is to commit the change using
git commit -m "My message"

The second is to stash it. stashing acts as a stack, where you can push changes, and you pop them in reverse order.
To stash type:
git stash
git pull
Do the merge, and than pull the stash:
git stash pop

The third options is to discard the local changes using 
git reset --hard

Zarshed Ali
Zarshed Ali
| 2 1 2
Answered on 1/9/15, 6:31 AM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This forum is for HiTechnologia Employees & just Odoo general knowledge purpose only.

Read Guidelines

Question tools

2 follower(s)


Asked: 1/9/15, 6:30 AM
Seen: 4242 times
Last updated: 1/9/15, 6:31 AM