git checkout <branch_name> # 切换submodule的branch git commit -am "change_summary" # 提交submodule的commit#or#更新submodule源码,默认更新的branch是master,如果要修改branch,在.gitmodule中设置git submodule update --remote <submodule_name>#更新所有submodule源码,默认更新.gitmodule中设置的跟踪分支,未设置...
提交submodule 我们在project-main下,git status发现,多出来的是.gitmodules和文件夹project-sub-1,我们将它们视为普通的文件,提交并推送到远程。 anders@ubuntu:~/repo/project-main$ git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) ...
1.用 git checkout master 将HEAD从游离状态切换到 master 分支, 这时候,git会报Warning说有一个提交没有在branch上,记住这个提交的change-id(假如change-id为 aaaa) 2.用 git cherry-pick aaaa 来将刚刚的提交作用在master分支上 3.用 git push 将更新提交到远程版本库中 删除子仓库 1.删除.gitsubmodule里...
9.随后我们在prepo再执行git submodule update,这时git将通过Internet把所有的submodule clone进入我们的子目录中(由.gitmodules文件来决定放到哪个子目录中) (newcnweibo_branch)$pwd/home/cabox/workspace/testgit/githubtest (newcnweibo_branch)$ls-la submods/newtestrepo/total8drwxrwxr-x2cabox cabox4096May...
# Push submodule change to its remote origin mastercd<submodule_name> git add -A . git commit -m"xxx"git checkout <detached branch name/number> git merge master git push -u origin master 定义 git submodule允许用户将一个 Git 仓库作为另一个 Git 仓库的子目录。 它能让你将另一个仓库克...
1.用git checkout master将HEAD从游离状态切换到 master 分支, 这时候,git会报Warning说有一个提交没有在branch上,记住这个提交的change-id(假如change-id为 aaaa) 2.用git cherry-pick aaaa来将刚刚的提交作用在master分支上 3.用git push将更新提交到远程版本库中 ...
Git pull 【remoteName】[localBranchName] #推送远程仓库: Git push 【remoteName】[localBranchName] #提交本地test 分支作为远程的master分支 Git push origin test:master #提交本地test 分支作为远程的test分支 Git push origin test:test 分支(branch)操作相关命令 ...
Here we have changed directory to the awesomelibrary submodule. We have created a new text filenew_awesome.txtwith some content and we have added and committed this new file to the submodule. Now let us change directories back to the parent repository and review the current state of the pare...
这里的坑在于,默认 git submodule update 并不会将 submodule 切到任何 branch,所以,默认下 submodule 的 HEAD 是处于游离状态的 (‘detached HEAD’ state)。所以在修改前,记得一定要用 git checkout master 将当前的 submodule 分支切换到 master,然后才能做修改和提交。
[--] <path>…)git submodule[--quiet] update [<options>] [--] [<path>…]git submodule[--quiet] set-branch [<options>] [--] <path>git submodule[--quiet] set-url [--] <path> <newurl>git submodule[--quiet] summary [<options>] [--] [<path>…]git submodule[--...