相关疑难解决方法(0)

仅存储使用Git更改的多个文件中的一个文件?

如何在我的分支上只隐藏多个已更改文件中的一个?

git git-stash

2895
推荐指数
20
解决办法
74万
查看次数

我怎样才能存储特定文件?

可能重复:
如何仅存储已更改的多个文件中的一个文件

如何保存特定文件,将当前已修改的其他文件保存在我要保存的存储区中?

例如,如果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")
Run Code Online (Sandbox Code Playgroud)

我只想藏匿app/views/cart/welcome.thtml,我该怎么做?有点像(但当然这不起作用):

git stash save welcome_cart app/views/cart/welcome.thtml
Run Code Online (Sandbox Code Playgroud)

git git-stash

1422
推荐指数
10
解决办法
57万
查看次数

你如何存放未跟踪的文件?

我对文件进行了更改,加上一个新文件,并希望在切换到另一个任务时使用git stash将它们删除.但git stash本身只会隐藏对现有文件的更改; 新文件仍然存在于我的工作树中,使我未来的工作变得混乱.如何存放这个未跟踪的文件?

git git-stash

1287
推荐指数
13
解决办法
39万
查看次数

标签 统计

git ×3

git-stash ×3