Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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