Skip to content

Commit 0051c22

Browse files
committed
Get all files submitted by git
1 parent d5db316 commit 0051c22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 获取 git 提交的所有文件
2+
3+
```bash
4+
git diff-tree -r --no-commit-id --name-only {commitId} | xargs tar -rf files.tar
5+
```
6+
7+
- `{commandId}` 提交历史记录的 Hash 值
8+
- `files.tar` 将变更的文件打包到当前目录下的 `files.tar` 文件中

0 commit comments

Comments
 (0)