当前位置: 动力学知识库 > 问答 > 编程问答 >

version control - Adding a reminder message in git about changes made to sub-tree repositories?

问题描述:

"What ends up happening is that the split off folder will live in two

repositories: the existing repo and the one setup as a subtree. You

need to explicitly commit changes to subtree. This is obviously a

mixed blessing. If you have a repository with a few occasional

committers, they can pull the original repository and push as if the

subtree didn’t exist. Then some one on the core team could

occasionally push to the subtree."

  • Los Techies, Using git Subtrees To Split a Repository

This is great and all, but is there a way to remind people committing that they are using a sub-tree repository, and also need to commit their changes individually in the sub-tree repo?

I'm thinking for instance:

  • Placing a message that appears as comments when adding a commit message.
  • Placing some sort of message that forces you to press a key, that appears in an on-commit hook.
  • Preventing use of the -m switch for commit messages.

网友答案:

Maybe you could use a CI server to keep the subtree repository up-to-date. People in the main project could just keep committing to the main repository without caring too much about the subtree and an automatically triggered CI job would perform the subtree push.

分享给朋友:
您可能感兴趣的文章:
随机阅读: