“Hiding” things in GIT

后端 未结 3 1625
臣服心动
臣服心动 2021-01-15 17:58

Git noob here.

I know this is against the principal of \"distributed source control\" but I want to \"password protect\" certain development branches in my GIT repos

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-15 18:23

    I don't think this is possible. It would make things like merging near impossible since git needs to know about the branches in order to make a merge. Consider the situation where one of your trusted developers merge something from the hidden branch to your main branch. Then a non-trusted developer tries to merge his changes -> how would you resolve the conflicts?

    But it's simple to get what you want: just have a separate repository and use that as a "branch" since merging from a different repository is about as easy as merging a branch in the same repository.

提交回复
热议问题