githubteacher / github-for-developers-sept-2015

practice repo for the Sept 29-30 GitHub for Developers class
12 stars 36 forks source link

While trying to merge, I get: "error: Your local changes to the following files would be overwritten by merge: Another file readme.md Please, commit your changes or stash them before you can merge. Aborting" #682

Closed snigdhajain closed 9 years ago

snigdhajain commented 9 years ago

How to force overwriting of local changes in this case?

Ziliboba commented 9 years ago

Seems that you have uncommited changes on your current branch. Do git commit -m "commit message", and then try to merge again.

NickGe commented 9 years ago

:+1:

saranicole commented 9 years ago

Make sure you have done a git pull first: git pull

If you have and you still have trouble you might have local uncommitted changes as @Ziliboba mentioned.

To stash (preserves local changes WITHOUT committing them): git stash \ git pull \ git stash pop

To reset (discards all local changes) git reset --hard

mkaleem4 commented 6 years ago

where am i entering these commands??

jamalfrnk commented 5 years ago

git bash

hualongfeng commented 5 years ago

I also see this error, but my branch clean, that is, it has be commit. How do I solve it.

himanshu4git commented 4 years ago

Faced same issue but my reason was quite different. I setup git on windows powershell few days ago . later i switched to cygwin and was doing git pull. :) switching back to windows powershell resolved the issue.

kirbyfern commented 4 years ago

@mkaleem4 on the terminal on your current local branch in your current project folder

sslsolutions commented 1 year ago

i want to keep the changes in my local branch