问题描述
所以我正在学习如此慢地使用git来获得RestKit的最新更新,因为旧版本保留了周期...足够公平但是,当我使用gitHub客户端时,它不会给我AFNetworking文件,然后我被告知使用命令
git submodule update --init --recursive
我这样做,问题在于我注意到运行后我运行了
git子模块状态
它让我从主分支并把头放回去,从而使我恢复到旧的东西。所以我想也许我可以使用cocoapods进行安装,或者可以在AFNetworking的restkit子模块中放置一个子模块......所有这些看起来并不像工作,现在我已经遵循本指南如何删除子模块?直到最后一步为止,因为我不知道承诺会做什么?我希望它不承诺我将所有内容都删除到restkit网站上?我很困惑,最初我想要做的就是将当前分支子模块切换到主人。
我们非常感谢帮助。
编辑:
好的,为了回答Commit做什么,commit只会影响你的版本库,并且不会影响远程的main版本库其他人都从他们的代码中获取代码,所以实质上我能够提交它,然后从我想要的分支中运行一个全新的子模块。但是问题仍然存在有没有一种方法可以在您使用更新为--recursive?
只需进入RestKit目录并键入:
git pull origin master
(if当然你也可以使用master分支)
另外,如果你需要更新所有的子模块,只需要到你的项目的根目录,然后输入:
git submodule foreach g它拉动
git子模块更新
在这里它真正的作用:
$ b
编辑
简单地切换子模块的分支,比如说'开发',只需在子模块 git checkout development
然后您应该可以执行 git pull origin development
So i am learning to ever so slowly use git to get me the latest update of RestKit as the old version has retain cycles...fair enough HOWEVER, when i pull using the gitHub Client it does not give me the AFNetworking files, which i was then told use the command
git submodule update --init --recursive
which i do, problem is that i noticed that after running that i run
git submodule status
It has taken me off the master branch and put the HEAD back in thus reverting me to old stuff. and hence back to leaks and stuff.
So i thought maybe i could install using cocoapods or perhaps put a submodule within the restkit submodule for AFNetworking...all did not seem to work and now i have followed this guide How do I remove a submodule? up until the last step as i dont know what committing will do? i hope it does not commit the fact that i deleted everything onto the restkit site? i am so confused, initially all i wanted to do was switch the current branch submodule i have to the master.
Assistance would be much appreciated.
EDIT:Okay as to answer what Commit does, commit only affects your copy of the repository and will in no way affect the remote "main" repository everyone else gets their code from, so in essence i was able to commit it, then run a brand new submodule from the branch i wanted, But the question still remains Is there a way to switch the branch you pull your data from when using the update with --recursive?
Simply go in th e RestKit directory and type:
git pull origin master
(if you use the master branch of course)
Also, if you need to update all your submodules, just go to the root of your project, and type:
git submodule foreach git pull
git submodule update
is confusing, here what it really does:
EDIT
To switch branch of a submodule simply, let say 'development', simply do in the submodule git checkout development
and then you should be able to do git pull origin development
这篇关于GIT与restKit混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!