[git] git pull 충돌 시 명령어 / please, commit your changes or stash them before you can merge.
git pull 했을때 아래와 같이 다른 사람의 commit과 충돌이 나는 경우가 발생합니다.
[oops]$ git pull
remote: Counting objects: 99, done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 69 (delta 51), reused 0 (delta 0)
Unpacking objects: 100% (69/69), done.
From 10.25.1.20:/work/git/oops
dab9a8b..b49cd63 master -> origin/master
Updating dab9a8b..b49cd63
error: Your local changes to the following files would be overwritten by merge:
Makefile
Please, commit your changes or stash them before you can merge.
Aborting
이때 사용할 수 있는 명령이 git stash입니다.
[oops]$ git stash
Saved working directory and index state WIP on master: dab9a8b [ferret] add cpuname procfile
HEAD is now at dab9a8b This is test commit
[oops]$
이후 pull하게 되면 정상적으로 처리 됩니다.