Git 拉取代码,排除特定文件更新
#!/bin/bash
拉取代码
git pull
不更新的文件名
exclude_file='file.txt'
判断文件是否存在
if [ -e '$exclude_file' ]; then
暂存文件
git stash save 'Exclude file $exclude_file'
拉取代码
git pull
恢复文件
git stash apply stash@{0} fi
echo '代码更新完成!'
原文地址: https://www.cveoy.top/t/topic/nDNH 著作权归作者所有。请勿转载和采集!