【发布时间】:2013-04-03 04:00:23
【问题描述】:
我需要创建一个没有父级的孤立分支。如何在 Smartgit 中进行操作?
在这方面需要一些指导..
【问题讨论】:
我需要创建一个没有父级的孤立分支。如何在 Smartgit 中进行操作?
在这方面需要一些指导..
【问题讨论】:
这是一个例子,如果 SmartGit 不支持 GUI 中的孤立选项,您也可以使用 CLI(命令行界面)并快速键入:
git checkout --orphan newbranch
(如“In git, is there a simple way of introducing an unrelated branch to a repository?”)
至少提交一个文件(仍然通过 GUI):
git add afile
git commit -m "a first commit in orphan branch"
# no push here, this is purely a local operation in your local repo
然后你回到 SmartGit,你的新(孤立)分支应该在那里。
【讨论】:
git add afile, git commit -m "first commit"),因为该分支还不能通过 SmartGit 看到。