简体   繁体   English

git branch和trunk文件夹是什么意思?

[英]What does git branches and trunk folder mean?

Git文件夹

Someone has share this source code with me. 有人与我共享了此源代码。 Which include three folders .Git, branches and trunk. 其中包括三个文件夹。Git,分支和主干。

I am familiar with git but usually when we take git clone we get two folders one of source code and one is .git folder inside that. 我对git很熟悉,但是通常当我们进行git clone时,会得到两个文件夹之一,源代码之一,其中一个是.git文件夹。 I need to know that what does these folders mean and which one contain the actual source code. 我需要知道这些文件夹是什么意思,哪个包含实际的源代码。

Thanks! 谢谢!

Before git was so popular, many people use subversion (svn). 在git如此流行之前,许多人都使用subversion(svn)。 In subversion the versioning is linear (revision 10, revision 11, and so on), there is no "inherent" branch and tag. 在Subversion中,版本控制是线性的(版本10,版本11等),没有“固有”分支和标记。 Using these structure is the conventional way to do branching and tagging: 使用这些结构是进行分支和标记的常规方法:

awesome-repository/
  trunk/
    README
    code.c
  branches/
    feature1/
      README
      code.c
    feature2/
      README
      code.c
    ...
  tags/
    v0.1/
      README
      code.c
    v0.2/
      README
      code.c
    ...

So, probably it is copied from subversion based repository to git based repository. 因此,可能会将其从基于Subversion的存储库复制到基于git的存储库。 And usually : 通常

  • master branch in git is in trunk/ directory in subversion git中的master分支位于subversion的trunk/目录中
  • other branches in git are in branches/*/ directories in subversion git中的其他分支位于subversion的branchs branches/*/目录中
  • tags in git are in tags/*/ directories in subversion git中的tags/*/位于subversion的tags/*/目录中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM