小编Geo*_*yan的帖子

从分支添加git子树

我正在尝试使用我的项目添加一个repo(称为cow)git subtree add.特别是,我想添加分支stable(不是master分支).我试过了:

git subtree add -P cow https://github.com/geoffryan/cow.git stable
Run Code Online (Sandbox Code Playgroud)

但是这返回了错误

'stable' does not refer to a commit.
Run Code Online (Sandbox Code Playgroud)

我也尝试过:

git subtree add -P cow https://github.com/geoffryan/cow.git cow/stable
'cow/stable' does not refer to a commit.
Run Code Online (Sandbox Code Playgroud)

和:

git subtree add -P cow https://github.com/geoffryan/cow.git ca26d248a12c21264e32a2c212381cafb578c9fb
'ca26d248a12c21264e32a2c212381cafb578c9fb' does not refer to a commit.
Run Code Online (Sandbox Code Playgroud)

哈希是stable分支中最新提交的哈希值.我在网上看到的使用示例都master用于提交,是否可以subtree add在非主分支上使用?

git git-subtree

16
推荐指数
1
解决办法
8997
查看次数

标签 统计

git ×1

git-subtree ×1