如何拯救污染的 --orphan 分支?

85 views
Skip to first unread message

Zoom.Quiet

unread,
Aug 21, 2017, 9:08:18 AM8/21/17
to shlug
故事是这样开始的:
- 有一个仓库
- 约定各自的工程在分支中进行
- master 只进行公共文档的维护
- 各分支永远不合并回 master
- 当然的, 各分支都是用 --orphan 参数创建的无头孤子分支

但是,有一位 MM 刚刚开始用 git, 参考 *雪峰 的教材来嗯哼
- 从 master 先 co 了一个分支
- 然后发觉没有 co 到应该的 DUW 分支
- 果断合并过去, 并好心的删除了 master co 过来的意外目录
- 于是结果是在其它人不知道的情况下
- 将 master 的几百个版本历史嫁接到 --orphan 分支中了

当然, 发觉后, 进行了紧急处理

- 手工备份 DUW 最新成果
- 然后, revert 这个分支版本到意外合并过来前的版本
- 再复制回最后的文件
- 等于放弃了过程中的一些版本
- 同时, 要求已经在不知情的时间本地有污染分支的复本的同学们
- 重新 clone 分支
- 并使用纯粹分支的复制方式
类似:

༄ mkdir DUW
༄ cd DUW
༄ git init
...
༄ git remote add -t DUW -f origin g...@github.com:XXXX/XXXXXXXX.git
༄ git co DUW
༄ git br -a
* DUW
remotes/origin/DUW


问题是今天, 又有同学没有进行本地复本的重建,再次将 --orphan 分支污染了

所以:
- 有办法将有效版本剪裁
- 恢复 --orphan 分支后
- 将协同的版本接回?

以及, 有什么办法, 可以根除这种比较迷糊的小伙伴,反复污染分支的情况发生?



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

Shell Xu

unread,
Aug 21, 2017, 10:16:17 AM8/21/17
to shlug
大妈,我觉得问题在你。
你让一堆不清楚自己在做什么的人,用一种能够修改历史的版本管理系统,没有培训,没有规范,而且连review/pr都没有?
信不信哪天某人直接干掉你的版本仓库,扔一个subversion源码进去?

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/

Tolbkni Kao

unread,
Aug 21, 2017, 11:26:59 AM8/21/17
to sh...@googlegroups.com
赞同,一般master和develop分支是protected branch,一般人是没有权限推送的。
其他分支随意折腾,注意Merge Request的时候做好code review即可

Shell Xu <shell...@gmail.com>于2017年8月21日 周一下午10:16写道:
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Zoom.Quiet

unread,
Aug 21, 2017, 11:57:57 AM8/21/17
to shlug
2017-08-21 22:15 GMT+08:00 Shell Xu <shell...@gmail.com>:
> 大妈,我觉得问题在你。
> 你让一堆不清楚自己在做什么的人,用一种能够修改历史的版本管理系统,没有培训,没有规范,而且连review/pr都没有?

是也乎,( ̄▽ ̄)
一时心痒, 制造了这种人为的玻璃花园,
为了以防大家乱来
另外构建了 playground 仓库,专门用来进行不确定时的嗯哼,
结果, 发现大家对自己的能力都异常的坚定,
无人试玩, 都直接上手的....

培训/规范...尝试过,基本上 42 小时后忘光, 重新直觉操作了...

> 信不信哪天某人直接干掉你的版本仓库,扔一个subversion源码进去?

这个也相信, 所以, 自己是另外都有备份的,
也感觉, 可能真心的得, 学员们制造几次血案后, 才能长心眼.
...

Zoom.Quiet

unread,
Aug 21, 2017, 12:00:52 PM8/21/17
to shlug
2017-08-21 23:26 GMT+08:00 Tolbkni Kao <tol...@gmail.com>:
> 赞同,一般master和develop分支是protected branch,一般人是没有权限推送的。

- 嗯哼? github 中怎么进行分支的权限控制?

> 其他分支随意折腾,注意Merge Request的时候做好code review即可

- 为了加速大家的嗯哼, 没有进行 Pull-Request 协同
- 全部自由的在一个仓库的不同分支中嗯哼
- 如附件图谱, 都是 --orphan 分支, 原本不应该出现 merge 的
- 只是没想到, git 的确支持这种操作...

>
> Shell Xu <shell...@gmail.com>于2017年8月21日 周一下午10:16写道:
>>
>> 大妈,我觉得问题在你。
>> 你让一堆不清楚自己在做什么的人,用一种能够修改历史的版本管理系统,没有培训,没有规范,而且连review/pr都没有?
>> 信不信哪天某人直接干掉你的版本仓库,扔一个subversion源码进去?
>>
>> 2017-08-21 21:07 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>>
>>> 故事是这样开始的:
>>> - 有一个仓库
>>> - 约定各自的工程在分支中进行
>>> - master 只进行公共文档的维护
>>> - 各分支永远不合并回 master
>>> - 当然的, 各分支都是用 --orphan 参数创建的无头孤子分支
>>>

屏幕快照 2017-08-21 23.59.17.png

依云

unread,
Aug 21, 2017, 12:10:40 PM8/21/17
to sh...@googlegroups.com
On Mon, Aug 21, 2017 at 09:07:52PM +0800, Zoom.Quiet wrote:
> [...]
>
> 问题是今天, 又有同学没有进行本地复本的重建,再次将 --orphan 分支污染了
>
> 所以:
> - 有办法将有效版本剪裁
> - 恢复 --orphan 分支后
> - 将协同的版本接回?

切到要修正的分支,然后 git rebase -i 要修改的起始提交,把要留在这个分支
上的提交留下,要弄到其它分支的另存,保存并退出。

切换到另外的分支,git rebase -i 找一个提交,然后把之前另存的提交信息粘贴
进来,保存并退出。

对修改过的分支做 forced push,然后通知所有人 git fetch 之后 git hard
--reset 到远程分支。

> 以及, 有什么办法, 可以根除这种比较迷糊的小伙伴,反复污染分支的情况发生?

最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
限的人还是会弄乱。复杂的话,写一个 update hook,检查如果有不合适的提交就
拒绝。

--
Best regards,
lilydjwg

Linux Vim Python 我的博客:
https://blog.lilydjwg.me/
--
A: Because it obfuscates the reading.
Q: Why is top posting so bad?

Shengjing Zhu

unread,
Aug 21, 2017, 8:40:05 PM8/21/17
to sh...@googlegroups.com
2017-08-21 21:07 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
> 故事是这样开始的:
> - 有一个仓库
> - 约定各自的工程在分支中进行
> - master 只进行公共文档的维护
> - 各分支永远不合并回 master
> - 当然的, 各分支都是用 --orphan 参数创建的无头孤子分支
>
> 但是,有一位 MM 刚刚开始用 git, 参考 *雪峰 的教材来嗯哼
> - 从 master 先 co 了一个分支
> - 然后发觉没有 co 到应该的 DUW 分支

首先还是少用意义不明的缩写。。比如 DUW,我是猜不出什么。

> - 果断合并过去, 并好心的删除了 master co 过来的意外目录
> - 于是结果是在其它人不知道的情况下
> - 将 master 的几百个版本历史嫁接到 --orphan 分支中了
>
> 当然, 发觉后, 进行了紧急处理
>
> - 手工备份 DUW 最新成果
> - 然后, revert 这个分支版本到意外合并过来前的版本

git revert?历史不还是还在吗?
看你后面的描述是指 reset 了吧,并且还 force push 了 remote repo。

> - 再复制回最后的文件
> - 等于放弃了过程中的一些版本
> - 同时, 要求已经在不知情的时间本地有污染分支的复本的同学们
> - 重新 clone 分支
> - 并使用纯粹分支的复制方式
> 类似:
>
> ༄ mkdir DUW
> ༄ cd DUW
> ༄ git init
> ...
> ༄ git remote add -t DUW -f origin g...@github.com:XXXX/XXXXXXXX.git
> ༄ git co DUW
> ༄ git br -a
> * DUW
> remotes/origin/DUW
>
>
> 问题是今天, 又有同学没有进行本地复本的重建,再次将 --orphan 分支污染了
>
> 所以:
> - 有办法将有效版本剪裁
> - 恢复 --orphan 分支后
> - 将协同的版本接回?
>
> 以及, 有什么办法, 可以根除这种比较迷糊的小伙伴,反复污染分支的情况发生?

不管是不是分支是不是 orphan 的,你要想别人别往你在意的分支 push dirty commit,
那么就不要给 push 的权限,要 push 代码就 push 到自己的分支,然后 pull request。

你 remote 的分支一旦是几个人共用的,就不应该存在 force push 的情况。

--
Regards,
Shengjing Zhu

Junle Li

unread,
Aug 21, 2017, 8:40:20 PM8/21/17
to sh...@googlegroups.com
远端的master没有policy保护?随便人都可以push?

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。

Zoom.Quiet

unread,
Aug 21, 2017, 9:31:49 PM8/21/17
to shlug
2017-08-21 22:10 GMT+08:00 Junle Li <lij...@gmail.com>:
> 远端的master没有policy保护?随便人都可以push?
>

猜对了, 就是普通的 github 仓库.
>> shlug+un...@googlegroups.com. For more options, visit this group at
>> https://groups.google.com/d/forum/shlug?hl=zh-CN
>> ---
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
>> 要查看更多选项,请访问 https://groups.google.com/d/optout
>
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
>
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问https://groups.google.com/d/optout

liyaoshi

unread,
Aug 21, 2017, 9:32:39 PM8/21/17
to sh...@googlegroups.com
我听下来的意思是,你需要8个虚拟机,每个虚拟机上面同时装同样的仓库
然后找人不停的复制虚拟机
再把各个不同的虚拟机上面的仓库merge到一个仓库里面去


您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。

Zoom.Quiet

unread,
Aug 21, 2017, 9:34:04 PM8/21/17
to shlug
2017-08-21 21:41 GMT+08:00 Shengjing Zhu <zsj9...@gmail.com>:
> 2017-08-21 21:07 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
...

>> 但是,有一位 MM 刚刚开始用 git, 参考 *雪峰 的教材来嗯哼
>> - 从 master 先 co 了一个分支
>> - 然后发觉没有 co 到应该的 DUW 分支
>
> 首先还是少用意义不明的缩写。。比如 DUW,我是猜不出什么。
>

好的, 当初只是为了节省输入, 并共同约定了一组内部工程缩写

>> - 果断合并过去, 并好心的删除了 master co 过来的意外目录
>> - 于是结果是在其它人不知道的情况下
>> - 将 master 的几百个版本历史嫁接到 --orphan 分支中了
>>
>> 当然, 发觉后, 进行了紧急处理
>>
>> - 手工备份 DUW 最新成果
>> - 然后, revert 这个分支版本到意外合并过来前的版本
>
> git revert?历史不还是还在吗?
> 看你后面的描述是指 reset 了吧,并且还 force push 了 remote repo。
>

对的, 是 reset ...

>> - 再复制回最后的文件
>> - 等于放弃了过程中的一些版本
>> - 同时, 要求已经在不知情的时间本地有污染分支的复本的同学们
>> - 重新 clone 分支
>> - 并使用纯粹分支的复制方式
>> 类似:
>>
>> ༄ mkdir DUW
>> ༄ cd DUW
>> ༄ git init
>> ...
>> ༄ git remote add -t DUW -f origin g...@github.com:XXXX/XXXXXXXX.git
>> ༄ git co DUW
>> ༄ git br -a
>> * DUW
>> remotes/origin/DUW
>>
>>
>> 问题是今天, 又有同学没有进行本地复本的重建,再次将 --orphan 分支污染了
>>
>> 所以:
>> - 有办法将有效版本剪裁
>> - 恢复 --orphan 分支后
>> - 将协同的版本接回?
>>
>> 以及, 有什么办法, 可以根除这种比较迷糊的小伙伴,反复污染分支的情况发生?
>
> 不管是不是分支是不是 orphan 的,你要想别人别往你在意的分支 push dirty commit,
> 那么就不要给 push 的权限,要 push 代码就 push 到自己的分支,然后 pull request。
>
> 你 remote 的分支一旦是几个人共用的,就不应该存在 force push 的情况。
>

原本设计就是所有人可以对所有分支进行随时嗯哼的,
鼓励大家相互协同的...
只是, 主要成员都是负基础非程序猿, 现学的...

...

Zoom.Quiet

unread,
Aug 21, 2017, 9:35:08 PM8/21/17
to shlug
2017-08-22 0:09 GMT+08:00 依云 <lily...@gmail.com>:
> On Mon, Aug 21, 2017 at 09:07:52PM +0800, Zoom.Quiet wrote:
>> [...]
>>
>> 问题是今天, 又有同学没有进行本地复本的重建,再次将 --orphan 分支污染了
>>
>> 所以:
>> - 有办法将有效版本剪裁
>> - 恢复 --orphan 分支后
>> - 将协同的版本接回?
>
> 切到要修正的分支,然后 git rebase -i 要修改的起始提交,把要留在这个分支
> 上的提交留下,要弄到其它分支的另存,保存并退出。
>
> 切换到另外的分支,git rebase -i 找一个提交,然后把之前另存的提交信息粘贴
> 进来,保存并退出。
>
> 对修改过的分支做 forced push,然后通知所有人 git fetch 之后 git hard
> --reset 到远程分支。
>

多谢, 有了思路就好折腾了 ;-)

>> 以及, 有什么办法, 可以根除这种比较迷糊的小伙伴,反复污染分支的情况发生?
>
> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权

这肯定是第一选择,
但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?

> 限的人还是会弄乱。复杂的话,写一个 update hook,检查如果有不合适的提交就
> 拒绝。
>
> --
> Best regards,
> lilydjwg
>
> Linux Vim Python 我的博客:
> https://blog.lilydjwg.me/
> --
> A: Because it obfuscates the reading.
> Q: Why is top posting so bad?
>
> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问 https://groups.google.com/d/optout



liyaoshi

unread,
Aug 21, 2017, 9:36:38 PM8/21/17
to sh...@googlegroups.com
这个时候就发觉docker真好啊

> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com

> 要查看更多选项,请访问 https://groups.google.com/d/optout



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。

Shengjing Zhu

unread,
Aug 22, 2017, 1:13:30 AM8/22/17
to sh...@googlegroups.com
2017-08-22 9:34 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>
>> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
>
> 这肯定是第一选择,
> 但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?

Not true.
https://help.github.com/articles/defining-the-mergeability-of-pull-requests/

--
Regards,
Shengjing Zhu

Zoom.Quiet

unread,
Aug 22, 2017, 1:38:53 AM8/22/17
to shlug
2017-08-22 11:30 GMT+08:00 Shengjing Zhu <zsj9...@gmail.com>:
> 2017-08-22 9:34 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>>
>>> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
>>
>> 这肯定是第一选择,
>> 但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?
>
> Not true.
> https://help.github.com/articles/defining-the-mergeability-of-pull-requests/
>

是也乎,( ̄▽ ̄)
多谢, 也正在搜索官方文档呢....
只是, 俺这个 案例中,
不是限制 br 的访问,
而是限制 从master 合并到 br 中...
这种行为算哪种 git 权限可以控制的呢?

学习中...

> --
> Regards,
> Shengjing Zhu
>
> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com

Shell Xu

unread,
Aug 22, 2017, 5:52:47 AM8/22/17
to shlug
大妈,比较简单的办法,就是干脆给上一套gitlab先用着。起码就有一commit一pr了,而且符合一般人用github的习惯。

2017-08-22 13:38 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
2017-08-22 11:30 GMT+08:00 Shengjing Zhu <zsj9...@gmail.com>:
> 2017-08-22 9:34 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>>
>>> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
>>
>> 这肯定是第一选择,
>> 但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?
>
> Not true.
> https://help.github.com/articles/defining-the-mergeability-of-pull-requests/
>

是也乎,( ̄▽ ̄)
多谢, 也正在搜索官方文档呢....
只是, 俺这个 案例中,
不是限制 br 的访问,
而是限制 从master 合并到 br 中...
这种行为算哪种 git 权限可以控制的呢?

学习中...

> --
> Regards,
> Shengjing Zhu
>
> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
> 要查看更多选项,请访问 https://groups.google.com/d/optout



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--

Rivsen

unread,
Aug 22, 2017, 5:59:41 AM8/22/17
to shlug
github有保护分支,我现在就是保护开发和产品分支,只能走pr,你的这个玩法我没搞过,不过你可以试试仙子的方法!提醒下,开多个repo会更舒服些……
Shell Xu <shell...@gmail.com>于2017年8月22日 周二下午5:52写道:
大妈,比较简单的办法,就是干脆给上一套gitlab先用着。起码就有一commit一pr了,而且符合一般人用github的习惯。
2017-08-22 13:38 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
2017-08-22 11:30 GMT+08:00 Shengjing Zhu <zsj9...@gmail.com>:
> 2017-08-22 9:34 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>>
>>> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
>>
>> 这肯定是第一选择,
>> 但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?
>
> Not true.
> https://help.github.com/articles/defining-the-mergeability-of-pull-requests/
>

是也乎,( ̄▽ ̄)
多谢, 也正在搜索官方文档呢....
只是, 俺这个 案例中,
不是限制 br 的访问,
而是限制 从master 合并到 br 中...
这种行为算哪种 git 权限可以控制的呢?

学习中...

> --
> Regards,
> Shengjing Zhu
>
> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问 https://groups.google.com/d/optout



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。

要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout
--

Send from my Nexus 5.

Easior Lars

unread,
Aug 22, 2017, 9:31:29 AM8/22/17
to shlug
很好奇,为什么要叫大妈?头像明明是个大兄弟。

Zoom.Quiet

unread,
Aug 22, 2017, 9:36:03 AM8/22/17
to shlug
2017-08-22 21:26 GMT+08:00 'Easior Lars' via Shanghai Linux User Group
<sh...@googlegroups.com>:
> 很好奇,为什么要叫大妈?头像明明是个大兄弟。
>

就和 ghosTM55 明明姓姚,却都叫 托总一样,
社区称号, 一系列哀伤的故事形成的后果...

> Sent from Yahoo Mail on Android
>
> On Tue, Aug 22, 2017 at 17:52, Shell Xu
> <shell...@gmail.com> wrote:
> 大妈,比较简单的办法,就是干脆给上一套gitlab先用着。起码就有一commit一pr了,而且符合一般人用github的习惯。
>
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问https://groups.google.com/d/optout



--

Zoom.Quiet

unread,
Aug 22, 2017, 9:37:29 AM8/22/17
to shlug
2017-08-22 17:59 GMT+08:00 Rivsen <rivse...@gmail.com>:
> github有保护分支,我现在就是保护开发和产品分支,只能走pr,你的这个玩法我没搞过,不过你可以试试仙子的方法!提醒下,开多个repo会更舒服些……

原先就是多仓库的,
结果发现成员相互根本不关心在作什么....
所以, 发明 玻璃花园:
- 所有人在同一仓库中
- 所有人的所有行为,都通过 github 插件提醒到列表中
- 所有人的所有行为强迫所有人感知到
- 形成压力,每天被动进步
...

> Shell Xu <shell...@gmail.com>于2017年8月22日 周二下午5:52写道:
>>
>> 大妈,比较简单的办法,就是干脆给上一套gitlab先用着。起码就有一commit一pr了,而且符合一般人用github的习惯。
>>
>> 2017-08-22 13:38 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>>
>>> 2017-08-22 11:30 GMT+08:00 Shengjing Zhu <zsj9...@gmail.com>:
>>> > 2017-08-22 9:34 GMT+08:00 Zoom.Quiet <zoom....@gmail.com>:
>>> >>>
>>> >>> 最简单的,只给不会用 git 的人他自己分支的写权限,但是有多个分支的提交权
>>> >>
>>> >> 这肯定是第一选择,
>>> >> 但是, github 仓库哪, 没法追加权限管理或是 hook 的吧?
>>> >
>>> > Not true.
>>> >
>>> > https://help.github.com/articles/defining-the-mergeability-of-pull-requests/
>>> >
>>>
>>> 是也乎,( ̄▽ ̄)
>>> 多谢, 也正在搜索官方文档呢....
>>> 只是, 俺这个 案例中,
>>> 不是限制 br 的访问,
>>> 而是限制 从master 合并到 br 中...
>>> 这种行为算哪种 git 权限可以控制的呢?
>>>
>>> 学习中...
>>>
>>> > --
>>> > Regards,
>>> > Shengjing Zhu
>>> >
>>> > --
>>> > -- You received this message because you are subscribed to the Google
>>> > Groups Shanghai Linux User Group group. To post to this group, send email to
>>> > sh...@googlegroups.com. To unsubscribe from this group, send email to
>>> > shlug+un...@googlegroups.com. For more options, visit this group at
>>> > https://groups.google.com/d/forum/shlug?hl=zh-CN
>>> > ---
>>> > 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>>> > 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
>>> > 要查看更多选项,请访问 https://groups.google.com/d/optout
>>>
>>>
>>>
>>> --
>>> life is pathetic, go Pythonic! 人生苦短, Python当歌!
>>> 俺: http://zoomquiet.io
>>> 授: http://creativecommons.org/licenses/by-sa/2.5/cn/
>>> 怒: 冗余不做,日子甭过!备份不做,十恶不赦!
>>> KM keep growing environment culture which promoting organization
>>> learning!
>>>
>>> --
>>> -- You received this message because you are subscribed to the Google
>>> Groups Shanghai Linux User Group group. To post to this group, send email to
>>> sh...@googlegroups.com. To unsubscribe from this group, send email to
>>> shlug+un...@googlegroups.com. For more options, visit this group at
>>> https://groups.google.com/d/forum/shlug?hl=zh-CN
>>> ---
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>>> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
>>> 要查看更多选项,请访问 https://groups.google.com/d/optout
>>
>>
>>
>>
>> --
>> 彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
>> blog: http://shell909090.org/
>> twitter: @shell909090
>> about.me: http://about.me/shell909090
>>
>> --
>> -- You received this message because you are subscribed to the Google
>> Groups Shanghai Linux User Group group. To post to this group, send email to
>> sh...@googlegroups.com. To unsubscribe from this group, send email to
>> shlug+un...@googlegroups.com. For more options, visit this group at
>> https://groups.google.com/d/forum/shlug?hl=zh-CN
>> ---
>> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
>> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
>> 要查看更多选项,请访问https://groups.google.com/d/optout
>
> --
>
> Send from my Nexus 5.
>

Han Lei

unread,
Aug 23, 2017, 7:54:29 AM8/23/17
to sh...@googlegroups.com
花钱买一套bitbucket的服务,然后自己搭建一套,按照使用人数收费,也没多少钱,还有人专门做技术支持。。

bitbucket里面可以做branch的权限设置。

推荐这个的原因就是我厂正在用,而且很稳定,花点小钱解决了这些infrastructure的事情,省下来的精力解决业务相关的问题。

>>> > shlug+unsubscribe@googlegroups.com. For more options, visit this group at

>>> > https://groups.google.com/d/forum/shlug?hl=zh-CN
>>> > ---
>>> > 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>>> > 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com

>>> > 要查看更多选项,请访问 https://groups.google.com/d/optout
>>>
>>>
>>>
>>> --
>>> life is pathetic, go Pythonic! 人生苦短, Python当歌!
>>> 俺: http://zoomquiet.io
>>> 授: http://creativecommons.org/licenses/by-sa/2.5/cn/
>>> 怒: 冗余不做,日子甭过!备份不做,十恶不赦!
>>> KM keep growing environment culture which promoting organization
>>> learning!
>>>
>>> --
>>> -- You received this message because you are subscribed to the Google
>>> Groups Shanghai Linux User Group group. To post to this group, send email to
>>> sh...@googlegroups.com. To unsubscribe from this group, send email to
>>> shlug+unsubscribe@googlegroups.com. For more options, visit this group at

>>> https://groups.google.com/d/forum/shlug?hl=zh-CN
>>> ---
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>>> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
>>> 要查看更多选项,请访问 https://groups.google.com/d/optout
>>
>>
>>
>>
>> --
>> 彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
>> blog: http://shell909090.org/
>> twitter: @shell909090
>> about.me: http://about.me/shell909090
>>
>> --
>> -- You received this message because you are subscribed to the Google
>> Groups Shanghai Linux User Group group. To post to this group, send email to
>> sh...@googlegroups.com. To unsubscribe from this group, send email to
>> shlug+unsubscribe@googlegroups.com. For more options, visit this group at

>> https://groups.google.com/d/forum/shlug?hl=zh-CN
>> ---
>> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
>> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
>> 要查看更多选项,请访问https://groups.google.com/d/optout
>
> --
>
> Send from my Nexus 5.
>
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+unsubscribe@googlegroups.com. For more options, visit this group at

> https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com

> 要查看更多选项,请访问https://groups.google.com/d/optout



--
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--
                           //////////\\\\
                           ( ~~ ~~ )
                          (   @ @   )
                            (    o    )
 -------------oOOo-----------oOOo--------------
Mit freundlichen Grüßen
Man proposes, God disposes .

Greetings from Oliver Twist
                                      0ooo
 ---------------------oooO---(   )------------------
                        (   )           )  /
                         \  (          (_/
                          \_)

Robert Lu

unread,
Aug 23, 2017, 10:35:01 PM8/23/17
to sh...@googlegroups.com
自己搭建Gitlab也支持保护分支的

-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Tolbkni Kao

unread,
Sep 1, 2017, 11:04:37 PM9/1/17
to sh...@googlegroups.com
大家不要安利其他DVCS系统了,哈哈,其实 GitHub 就有这个功能


Shengjing Zhu 提到的链接里就有对 protected branches 的说明

自己搭建Gitlab也支持保护分支的


-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout
Reply all
Reply to author
Forward
0 new messages