git - Pulling with GitHub? -
this question has answer here:
the remote repository newer version local repository, , have made changes local repository. how merge two? when try "git pull origin master", gives me "commit changes or stash them" error.
is there anyway merge easily?
you have few options:
if you're done local changes, go ahead , commit them. then, when
git pull origin master
, git merge remote changes local ones, or ask merge manually if cannot.if you're not quite done you're working on locally, can
git stash
, "stashes" changes away temporarily. once that, cangit pull origin master
, reapply changes usinggit stash pop
. again, if there merge conflicts, need handle them yourself.if you're ok tossing out local changes,
git checkout .
, pull down remote. needless say, lose whatever working on locally.
Comments
Post a Comment