git: How can I merge my working file with the latest one -


i'm new git, , still having lot of trouble.

say i'm working on a.cpp. modified code in a.cpp. and, change not ready commit or push.

then, other people made change in a.cpp.

in svn/cvs, checking out either merge or conflict.

i thought git pull same thing.

but, seems git pull doesn't merge/conflict. correct behavior?

also, git checkout rewrites a.cpp, losing changes.

is there easy way pull latest version , perform merge/conflict?

before pull, stash changes. after pull, can pop stashed changes , rebase them on newest commit.

first stash changes

git stash 

you can view stashes running stash show. if haven't stashed before should see 1 stash. can pull without overwriting changes:

git pull 

now remove changes stash , apply them checked out version:

git stash pop 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -