提交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) ...
git commit -am "change_summary" # 提交submodule的commit#or#更新submodule源码,默认更新的branch是master,如果要修改branch,在.gitmodule中设置git submodule update --remote <submodule_name>#更新所有submodule源码,默认更新.gitmodule中设置的跟踪分支,未设置则跟踪mastergit submodule update --remote#当submodule ...
用git checkout master将 HEAD 从游离状态切换到 master 分支 , 这时候,git 会报 Warning 说有一个提交没有在 branch 上,记住这个提交的 change-id(假如 change-id 为 aaaa)。 用git cherry-pick aaaa来将刚刚的提交作用在 master 分支上。 用git push将更新提交到远程版本库中。 3.3、删除 submodule : 有...
git branch branch_0.1 master 从主分支master创建branch_0.1分支 git branch -m branch_0.1 branch_1.0 将branch_0.1重命名为branch_1.0 git checkout branch_1.0/master 切换到branch_1.0/master分支 du -hs git branch 删除远程branch git push origin :branch_remote_name git branch -r -d branch_remote_n...
1.用git checkout master将HEAD从游离状态切换到 master 分支, 这时候,git会报Warning说有一个提交没有在branch上,记住这个提交的change-id(假如change-id为 aaaa) 2.用git cherry-pick aaaa来将刚刚的提交作用在master分支上 3.用git push将更新提交到远程版本库中 ...
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...
[--] <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[--...
Git pull 【remoteName】[localBranchName] #推送远程仓库: Git push 【remoteName】[localBranchName] #提交本地test 分支作为远程的master分支 Git push origin test:master #提交本地test 分支作为远程的test分支 Git push origin test:test 分支(branch)操作相关命令 ...
git branchrefuses to change an existing branch. In combination with-d(or--delete), allow deleting the branch irrespective of its merged status, or whether it even points to a valid commit. In combination with-m(or--move), allow renaming the branch even if the new branch name already ...
这里的坑在于,默认 git submodule update 并不会将 submodule 切到任何 branch,所以,默认下 submodule 的 HEAD 是处于游离状态的 (‘detached HEAD’ state)。所以在修改前,记得一定要用 git checkout master 将当前的 submodule 分支切换到 master,然后才能做修改和提交。