我怎样才能存储特定文件? [重复] - How can I git stash a specific file? [duplicate]

08/10 02:37
阅读数 74

问题:

Possible Duplicate: 可能重复:
How to stash only one file out of multiple files that have changed 如何从已更改的多个文件中仅存储一个文件

How can I stash a specific file leaving the others currently modified out of the stash I am about to save? 如何保存特定文件,将当前已修改的其他文件保存在我要保存的存储区中?

For example, if git status gives me this: 例如,如果git status给我这个:

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")

and I only want to stash app/views/cart/welcome.thtml, how would I do that? 我只想藏匿app / views / cart / welcome.thtml,我该怎么做? Something like (but of course this does not work): 有点像(但当然这不起作用):

git stash save welcome_cart app/views/cart/welcome.thtml

解决方案:

参考一: https://stackoom.com/question/N6Rv/我怎样才能存储特定文件-重复
参考二: https://oldbug.net/q/N6Rv/How-can-I-git-stash-a-specific-file-duplicate
展开阅读全文
git
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
在线直播报名
返回顶部
顶部