是否有可能在Git中创建分支? [英] Is it possible to alias a branch in Git?
问题描述
这可能会给SVN用户带来一些舒适感。我知道我可以创建一个名为trunk的分支,但似乎偏离了git规范,可能会导致一些用户感到困惑。
我知道我也可以创建和删除标签,但是当我签出这些标签时,它告诉我这是一个非本地分支,这对我来说很好但可能不是我想要做的。
我是git newb,但是在发布和构建系统方面经验丰富。
我想要做的就是能够调用master trunk。我已经看到了别名命令的功能,这是否适用于名称版本化的对象呢?
我知道git-svn的存在和其他工具,但是分层存储库系统的开销让我感到担忧。
您可以按照Greg的建议重新命名主分支中继,或者也可以创建一个主分支,这是对主分支的符号引用,以便git和svn用户都拥有'main'分支它们是习惯的。
git symbolic-ref refs / heads / trunk refs / heads / master
code>
请注意,后备箱不是头等公民。如果您签出 trunk
并执行 git status
,您将实际上位于 master
,但是您可以在所有使用分支名称(log,merge等)的地方使用 trunk
命令。
I am looking into using git on a massive scale. I was hoping to increase adoption and make things easier by calling the master branch trunk.
This can and will give SVN users some feelings of comfort. I know I can create a branch called trunk but that seems to deviate from the git norms and might cause some users to get confused.
I know that I can also create and delete tags to my heart's content but when I checkout those tags it tells me it is a non local branch which is just fine with me but probably not what I want to be doing.
I am a total git newb but a seasoned professional at release and build systems.
What I want to do is to be able to call master trunk. I have seen the ability to alias commands does this apply for the names of versioned objects as well?
I know git-svn exists and other tools but the overhead of layered repository systems frightens me.
You can rename the master branch trunk as Greg has suggested, or you can also create a trunk that is a symbolic reference to the master branch so that both git and svn users have the 'main' branch that they are used to.
git symbolic-ref refs/heads/trunk refs/heads/master
Note that trunk isn't a first class citizen. If you checkout trunk
and perform a git status
you will actually be on master
, however you can use the trunk
command in all places that you use the branch name (log, merge, etc.).
这篇关于是否有可能在Git中创建分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!