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

Zarshed Ali
Zarshed Ali
5000
| 2 1 2
Asked on 1/9/15, 6:30 AM
0
vote
3873 Views

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
5000
| 2 1 2
Answered on 1/9/15, 6:31 AM
0
vote

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)

Stats

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