我如何将特定文件暂存,而其他当前修改的文件不包含在即将保存的暂存中?
例如,如果git状态给出以下结果:
younker % gst
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# 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: app/controllers/cart_controller.php
# modified: app/views/cart/welcome.thtml
#
no changes added to commit (use "git add" and/or "git commit -a")
我只想将 app/views/cart/welcome.thtml 存储,应该怎么做?类似以下方式(但这当然不起作用):
git stash save welcome_cart app/views/cart/welcome.thtml
git checkout -- 文件名
命令将其还原为原始状态。 - visualex