git checkout master 进入newtestrepo的master branch, 修改文件,commit,随后git push,注意这里的push是将submodule push到中央库中。注意:submodule/newtestrepo目录下不再有.git目录,而只有一个.git文件,这一点很是奇妙! 在我们的submodule的目录中,你查看一下.git这个文件(不是文件夹哦!)的内容实际上指示列出来...
有些时候你需要对submodule做一些修改,很常见的做法就是切到submodule的目录,然后做修改,然后commit和push。 这里的坑在于,默认git submodule update并不会将submodule切到任何branch,所以,默认下submodule的HEAD是处于游离状态的(‘detached HEAD’ state)。所以在修改前,记得一定要用git checkout master将当前的submodule...
For more information about submodules, seegitsubmodules[7]. COMMANDS With no arguments, shows the status of existing submodules. Several subcommands are available to perform operations on the submodules. add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--ref...
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...
Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) Git还会自动提示我们当前master分支比远程的master分支要超前1个提交。 在master分支上把readme.txt文件的最后一行改为: goback master... 提交...
the commit recorded in the superproject will be merged into the current branch in the submodule. The followingupdateprocedures are only available via thesubmodule.<name>.updateconfiguration variable: custom command arbitrary shell command that takes a single argument (the sha1 of the commit recorded ...
git/submodule:更新后提前分离--变基将当前分支重定基到超级项目中记录的提交。如果给出了这个选项,子...
git branch -d <name> git branch -D <name>#强行删除,慎用 1.7 模块管理git submodule 1.7.1 添加子模块 git submodule add <URL of the submodule> <folder's name of the submodule> 使用此命令后,项目根目录下会自动添加.gitmodules文件,用来存放子模块的信息;同时,也会自动下载子模块仓库的主分支最新...
git branch 是操作分支 git checkout 实质上是移动 HEAD(指向提交记录),git checkout [commit_name] 所以,在HEAD指向分支的情况下git checkout [commit_name],也可以理解为git checkout [branch_name] (1) 查看分支(branch) git branch # 查看本地所有分支 git branch -a git branch -r # 查看远程分支 ...
远程分支反映了远程仓库 (在你上次和它通信时) 的状态,远程分支命名规范:<remote repository name>/<branch name>,repository 一般为 origin,这是因为当你用 git clone 某个仓库时,git 已经帮你把远程仓库的名称设置为 origin 了。远程分支有一个特别的属性,在你检出时自动进入分离 HEAD 状态。Git 这么做是出于...