Skip to content

Instantly share code, notes, and snippets.

@cesclong
Created March 19, 2026 06:05
Show Gist options
  • Select an option

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

Select an option

Save cesclong/2edc9ddb1b599226c2b0586397e85bdc to your computer and use it in GitHub Desktop.
生成【纯配置分支】(只留配置,代码恢复成 develop)
# 切回你原来的开发分支
git checkout 你的分支名
# 新建纯配置分支
git checkout -b feat/only-config
# 把【除配置外的所有文件】恢复成 develop(配置不动)
git checkout develop -- $(git ls-files | grep -vE '\.(json|yml|yaml|env|conf|ini|properties)$')
# 提交
git add .
git commit -m "chore: 仅配置改动,代码恢复到develop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment