Tôi đang cố gắng tìm ra cách để lưu trữ hai tệp cụ thể trong số nhiều thay đổi không được cam kết.Git: làm thế nào để sử dụng stash -p để stash các tập tin cụ thể?
Câu trả lời rất hứa hẹn này, Stash only one file out of multiple files that have changed with Git?, không hiển thị mức sử dụng và tôi đang gặp sự cố khi sử dụng.
Sau đây không hoạt động và trang người đàn ông không phải là rất hữu ích (nó xuất hiện để nói về đầu ra thiết bị đầu cuối, không thực sự stashing). Tôi muốn stash application.conf
và plugins.sbt
và sau đó cam kết mọi thứ khác.
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
hoặc git stash -p – Matthias