Git分支当前分支的另一个分支 [英] Git branch another branch from current branch

查看:149
本文介绍了Git分支当前分支的另一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你当前的分支是master,如果你创建了另一个分支,就像那个git分支开发的那样,那么在分支开发中,你将拥有关于master.how的类似代码,我可以得到一个空分支。



<$ p

$ p> git checkout --orphan develop

这是自git 1.7。 2:参见在git中,是否有一种将不相关分支引入到存储库的简单方法?


Your current branch is master and if u create another branch like that git branch develop,then in branch develop you will have similar code about master。how can i get an empty branch.

解决方案

You can create an orphan branch, which start without parent, and will be effectively "empty".

git checkout --orphan develop

This is since git 1.7.2: see "In git, is there a simple way of introducing an unrelated branch to a repository?".

这篇关于Git分支当前分支的另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆