我经常将我完成的工作隐藏在新的(未跟踪的)文件中,并且我希望以后能够找到这项工作。找到它的明显方法似乎是git show。
我刚刚发现,当我使用时,Git 完全忽略了这些文件git show(但幸运的是,在弹出隐藏代码时并没有忽略它们),这使得可靠地找到隐藏代码似乎是不可能的。
为了使这个更具体,假设我有
On branch feature/request-reappointment
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: app/models/job.rb
modified: config/initializers/environmental_email_interceptor.rb
Untracked files:
(use "git add <file>..." to include in what will be committed)
app/models/receipt.rb
db/migrate/20200130091050_create_receipts.rb
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
如果我表演
git stash save -u 'miscellaneous improvements'
git show stash@{0}
Run Code Online (Sandbox Code Playgroud)
Git …
git ×1