git管理代码报错(使用Sourcetree工具) 有子模块Submodule(未解决)

本文介绍在使用Sourcetree工具进行Git操作时遇到的子模块(Submodule)相关错误,包括克隆(master分支)及合并分支过程中出现的问题,并提供了解决这些问题的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


git报错(使用Sourcetree工具)


//1克隆master (有子模块Submodule)
Submodule 'ReactiveCocoa' (https://github.com/ReactiveCocoa/ReactiveCocoa.git) registered for path 'ReactiveCocoa'

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone --branch masterhttp://x.x.x.x/project/project-iOS.git /Users/zhanglizhi/Desktop/17_5_9 校优 _T
Cloning into '/Users/zhanglizhi/Desktop/17_5_9 校优 _T'...
warning: templates not found /usr/local/git/share/git-core/templates


git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'Pods'
Completed with errors, see above

//2合并分支(有子模块Submodule)
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree submodule update --init --recursive
Cloning into 'ReactiveCocoa'...
warning: templates not found /usr/local/git/share/git-core/templates
fatal: reference is not a tree: 89ebed97bffb4116dba39b665d1f1ecb27004d92
Unable to checkout '89ebed97bffb4116dba39b665d1f1ecb27004d92' in submodule path 'ReactiveCocoa'
Submodule 'ReactiveCocoa' (https://github.com/ReactiveCocoa/ReactiveCocoa.git) registered for path 'ReactiveCocoa'
Completed with errors, see above

使用命令:

1.去到相应的子模块ReactiveCocoa (Submodule)

cd /Users/zhanglizhi/Desktop/项目_hh/ReactiveCocoa


2.查看状态

git status


3.返回主分支

git checkout master


4.可以更新

git submodule update --remote



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值