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中设置的跟踪分支,未设置...
添加子模块:$ git submodule add [url] [path] 如:$git submodule add git://github.com/soberh/ui-libs.git src/main/webapp/ui-libs 初始化子模块:$ git submodule init ---只在首次检出仓库时运行一次就行 更新子模块:$ git submodule update ---每次更新或切换分支后都需要运行一下 删除子模块:(分...
lighthouse@VM-8-10-ubuntu:gitcode$ git checkout master Switched to branch'master'lighthouse@VM-8-10-ubuntu:gitcode$ git merge--no-ff-m"merge with no-ff"dev2 Merge made by the'ort'strategy.book|1+1file changed,1insertion(+)lighthouse@VM-8-10-ubuntu:gitcode$ cat book Hello Island13...
NOTE:The latter form is just a short-hand ofgit checkout topicfollowed bygit rebase master. When rebase exitstopicwill remain the checked-out branch. If the upstream branch already contains a change you have made (e.g., because you mailed a patch which was applied upstream), then that co...
Git pull 【remoteName】[localBranchName] #推送远程仓库: Git push 【remoteName】[localBranchName] #提交本地test 分支作为远程的master分支 Git push origin test:master #提交本地test 分支作为远程的test分支 Git push origin test:test 分支(branch)操作相关命令 ...
[--] <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[--...
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...
1.用git checkout master将HEAD从游离状态切换到 master 分支, 这时候,git会报Warning说有一个提交没有在branch上,记住这个提交的change-id(假如change-id为 aaaa) 2.用git cherry-pick aaaa来将刚刚的提交作用在master分支上 3.用git push将更新提交到远程版本库中 ...
用git checkout master将 HEAD 从游离状态切换到 master 分支 , 这时候,git 会报 Warning 说有一个提交没有在 branch 上,记住这个提交的 change-id(假如 change-id 为 aaaa)。 用git cherry-pick aaaa来将刚刚的提交作用在 master 分支上。 用git push将更新提交到远程版本库中。 3.3、删除 submodule : 有...
提交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) ...