Skip to content

Instantly share code, notes, and snippets.

@cesclong
Last active March 19, 2026 07:30
Show Gist options
  • Select an option

  • Save cesclong/e060c428e6e324eb1be8b40b17a09e9c to your computer and use it in GitHub Desktop.

Select an option

Save cesclong/e060c428e6e324eb1be8b40b17a09e9c to your computer and use it in GitHub Desktop.
新 2. 生成【纯配置分支】(只留配置,代码=develop)
git checkout 你的分支名
git checkout -b feat/only-config
git ls-files -z | grep -zvE '\.(json|yml|yaml|env|conf|ini|properties)$' | xargs -0I{} git checkout develop -- {} 2>/dev/null
git add .
git commit -m "chore: 仅配置改动,代码恢复到 develop"
git diff develop --name-only -z --
# 只把「你改过的代码文件」恢复回来
git diff develop --name-only -z -- \
':!*.json' ':!*.yml' ':!*.yaml' ':!*.env' ':!*.conf' ':!*.ini' ':!*.properties' \
| xargs -0 git checkout 你的分支名 --
git add .
git commit -m "feat: 仅代码改动(对比de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment