Skip to content

Commit 0f8f7dd

Browse files
committed
WIP
1 parent 0051c22 commit 0f8f7dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/.vitepress/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ function sidebarOthers()
7676
// collapsible: true,
7777
// collapsed: false,
7878
items: [
79-
{text: "VitePress初始化", link: "/others/vitepress/getting-started"},
79+
{text: "VitePress 初始化", link: "/others/vitepress/getting-started"},
80+
{text: "获取 git 提交的所有文件", link: "/others/git/get-all-files-submitted-by-git"},
8081
]
8182
}
8283
];

docs/others/git/get-all-files-submitted-by-git.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
```bash
44
git diff-tree -r --no-commit-id --name-only {commitId} | xargs tar -rf files.tar
5+
6+
# 获取最后一次提交时变更的所有文件
7+
git diff-tree -r --no-commit-id --name-only `git rev-parse HEAD` | xargs tar -rf files.tar
58
```
69

710
- `{commandId}` 提交历史记录的 Hash 值
8-
- `files.tar` 将变更的文件打包到当前目录下的 `files.tar` 文件中
11+
- `files.tar` 将变更的文件打包到当前目录下的 `files.tar` 文件中
12+
- `git rev-parse HEAD` 获取最后一次提交的 Hash 值

0 commit comments

Comments
 (0)