$ git pull error: Your local changes to the following files would be overwritten by merge: src/components/page/file.vue Please commit your changes or stash them before you merge. Aborting Updating 8e191be..c301cdc
$ git stash Saved working directory and index state WIP on master: 8e191be Merge branch 'master' of https://github.com/anran758/test HEAD is now at 8e191be Merge branch 'master' of https://github.com/anran758/test $ git status # On branch master nothing to commit, working directory clean
$ git stash list stash@{0}: WIP on master: 8e191be Merge branch 'master' of https://github.com/anran758/test
这时我们还原储藏的内容, 使用命令git stash pop 'stash@{0}'. 注意这里的要使用引号'stash@{0}', 因为shell正在使用扩展里的内容, 否则会报一个unknown option: -encodedCommand
1 2 3 4 5 6 7 8 9 10 11
$ git stash pop 'stash@{0}' Auto-merging src/components/page/file.vue On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)
modified: src/components/page/film.vue
no changes added to commit (use "git add" and/or "git commit -a")