shell,git 技巧积累

shell,git 技巧积累 字符串分割成数组#!/bin/bashaaas/,dfs/,dms/IFS,read-raarr$aforiin${arr[]};doecho$i;b${i%/}#从右边开始去除“/”echo$bdone查找当前目录下的目录去除.find.-typed-mindepth1-maxdepth1repo init --no-tags --no-clone-bundle --no-repo-verify --depth1 --current-branch 配置后下载的代码不包含全部历史记录但有时需要回退到某个commit id处cd某仓库gitcheckout branchgitfetch--unshallowgitcheckout commitid 或gitreset--hardcommitid反向匹配行target_substr$(grep-v^[[:space:]]*#test_list.txt)