【发布时间】:2023-03-11 04:02:01
【问题描述】:
我试图弄清楚如何在许多未提交的更改中存储两个特定文件。
这个非常有希望的答案Stash only one file out of multiple files that have changed with Git? 没有显示用法,我无法解决。
以下内容不起作用,手册页也不是很有帮助(它似乎在谈论终端输出,而不是实际存储)。我想隐藏application.conf 和plugins.sbt,然后提交其他所有内容。
app (master)$ git status
On branch master
Your branch is ahead of 'origin/master' by 29 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: views/mobile/blog.scala.html
modified: views/mobile/slideshow.scala.html
modified: ../public/css/mobile/styles.css
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: ../conf/application.conf
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: ../project/plugins.sbt
app (master)$ git stash -p ../conf/application.conf ../project/plugins.sbt
usage: git stash list [<options>]
or: git stash show [<stash>]
or: git stash drop [-q|--quiet] [<stash>]
or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: git stash branch <branchname> [<stash>]
or: git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [<message>]]
or: git stash clear
【问题讨论】: