学科:Git

来自维基学院
相关链接
软件开发 Subject:shell

里程碑(Tag)[编辑 | 编辑源代码]

移除远端版本库里程碑[编辑 | 编辑源代码]

命令:

git push <remote_url> :<tagname>

例:

$ git push origin :RFGridView_0.1.0
To git@github.com:BB9z/RFUI.git
 - [deleted]         RFGridView_0.1.0

可使用 git ls-remote 查看变化。

参考:

Submodule[编辑 | 编辑源代码]

嵌套更新[编辑 | 编辑源代码]

git submodule foreach --recursive git submodule init
git submodule foreach --recursive git submodule update

参考:


改变历史[编辑 | 编辑源代码]

精简历史[编辑 | 编辑源代码]

比如要抛弃tag A以前的历史

  1. 首先要从A创建一个目录树,命令示例:
$ echo "从A重建" | git commit-tree A^{tree}

会创建一个根提交并输出改提交hash,假设该根提交为1234567。

  1. 将A以后的分支变基到该跟提交上,示例:
$ git rebase --onto 1234567 A master


Github Tips[编辑 | 编辑源代码]

GitHub Pages[编辑 | 编辑源代码]

搭建Git服务器[编辑 | 编辑源代码]

FAQs[编辑 | 编辑源代码]

Vs. Mercurial[编辑 | 编辑源代码]

参考[编辑 | 编辑源代码]

教学[编辑 | 编辑源代码]