有些时候你需要对submodule做一些修改,很常见的做法就是切到submodule的目录,然后做修改,然后commit和push。 这里的坑在于,默认git submodule update并不会将submodule切到任何branch,所以,默认下submodule的HEAD是处于游离状态的(‘detached HEAD’ state)。所以在修改前,记得一定
git checkout master 进入newtestrepo的master branch, 修改文件,commit,随后git push,注意这里的push是将submodule push到中央库中。注意:submodule/newtestrepo目录下不再有.git目录,而只有一个.git文件,这一点很是奇妙! 在我们的submodule的目录中,你查看一下.git这个文件(不是文件夹哦!)的内容实际上指示列出来...
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... 提交...
$ git config -f .gitmodules submodule.DbConnector.branch stable $ git submodule update --remote remote: Counting objects: 4, done. remote: Compressing objects: 100% (2/2), done. remote: Total 4 (delta 2), reused 4 (delta 2) Unpacking objects: 100% (4/4), done. From https://gith...
git/submodule:更新后提前分离--变基将当前分支重定基到超级项目中记录的提交。如果给出了这个选项,子...
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 # 查看远程分支 ...
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 -D crazy-experiment This deletes the branch regardless of its status and without warnings, so use it judiciously. The previous commands will delete a local copy of a branch. The branch may still exist in remote repos. To delete a remote branch execute the following. ...