每次构建都是用 git clone ,随着历史版本越来越大也就越来越慢。
最近发现有 --depth 1 这种用法,刚激动了一下,忽然想起来我每次并不是构建 head 啊。
|  |      1zhs227      2017-04-15 20:54:30 +08:00 构建不应该是用 git pull 么,为什么会用 clone 呢 只有库不存在的时候才需要 clone 。都是历史数据, pull 的结果也是精确可信的 | 
|      2whileFalse OP 自己回答,可以拉指定分支,但不能是提交。 git clone -b mybranch --single-branch --depth 1 | 
|  |      3miaotaizi      2017-04-15 21:00:44 +08:00 via iPhone 克隆下来再切换分支不行嘛? | 
|  |      4coderfox      2017-04-15 21:02:04 +08:00 via Android 构建别人的应用可以在原来的仓库 git pull ,没必要重新 clone 。 | 
|      5whileFalse OP | 
|  |      6xlvecle      2017-04-15 23:42:17 +08:00 @whileFalse 具体描述下?觉得这个历史原因很神奇,想看看是多么邪门儿的 git workflow | 
|  |      7crysislinux      2017-04-16 08:53:22 +08:00 via Android 用 clone 构建也很正常吧,比如每次构建的服务器都是同样的环境,并不会保存上次的 clone | 
|      8Arthur2e5      2017-04-17 01:37:57 +08:00 有没有想过加 tag 呢? git clone 的 -b 也可以是 tag 的呢。 | 
|  |      9AngryPanda      2019-03-28 18:33:58 +08:00 @crysislinux +1 |