stash & stash pop

当你正在写一段代码的时候,突然有其他事请需要打断你编码的过程,此时使用git的正确姿势应该是:

git stash

把当前未提交的改动“复制”到另一个地方暂存起来,使用git status命令可以发现

On branch master
nothing to commit, working directory clean

待要恢复的时候执行:

git stash pop

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s