mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
20 lines
533 B
Bash
Executable File
20 lines
533 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# 获取所有由我们删除的文件列表
|
|
deleted_files=$(git status --short | grep '^DU' | awk '{print $2}')
|
|
|
|
# 检查是否找到了任何文件
|
|
if [[ -z "$deleted_files" ]]; then
|
|
echo "没有找到由我们删除的文件。"
|
|
exit 0
|
|
fi
|
|
|
|
# 遍历文件列表并忽略它们
|
|
for file in $deleted_files; do
|
|
echo "忽略文件: $file"
|
|
git rm --cached "$file"
|
|
done
|
|
|
|
# 提示用户提交更改
|
|
echo "已忽略所有由我们删除的文件。"
|
|
echo "你可以使用 'git commit' 来提交这些更改。" |