如何删除不在文件夹列表中的文件夹?

时间:2018-07-09 15:17:36

标签: git shell

我正在使用jenkins / git,我想从旧的git分支中清除目录(/ var / www / branches /),此分支表示为其他目录中的文件夹(是我git存储库的一部分),我要做的是,我使用命令检索当前工作的分支并将其放入文件中:

listBranchRemote=$(git --git-dir=$gitDirectory/.git branch -qr |cut -d'/' -f 2,3 | tee -a branch.txt

branch.txt代表唯一应保留在/ var / www / branches /目录中的文件夹。如何删除不在我创建的文件中的文件夹。

1 个答案:

答案 0 :(得分:0)

您可以应用与“ How to iterate through all git branches using bash script”类似的过程,除了您需要:

相关问题