EN 学习

来源:互联网 发布:刷球球大作战圣衣软件 编辑:程序博客网 时间:2024/04/30 02:12
【S】Specify the repository to track. This can be a URL or a local file path.   【C】Note that for super-projects (repositories with submodules), only a local file path or a complete URL is valid. For instance(《金字塔原理》疑问之前给用户举例或故事), user@host:/path is not a valid URL. The following are examples of valid git URLs.
  • http://github.com/github/git.git
  • git://github.com/github/git.git
  • ssh://git@github.com/github/git.git
  • ssh://user@other.host.com/~/repos/R.git (to access the repos/R.git repository in the user's home directory)

【Q】

If the repository is a super-project, the location from which to clone submodules is dependent on whether the repository is bare or non-bare (i.e. has a working directory).

  • If the super-project is bare, the location of the submodules will be taken from.gitmodules.
  • If the super-project is not bare, it is assumed that the repository has each of its submodules cloned and checked out appropriately. Thus, the submodules will be taken directly from a path like${SUPER_PROJECT_URL}/${SUBMODULE}, rather than relying on information from.gitmodules.

【A】

For a local URL/path to a super-project, git rev-parse --is-bare-repository is used to detect whether the super-project is bare or not.

For a remote URL to a super-project, the ending of the URL determines whether a bare or non-bare repository is assumed:
  • If the remote URL ends with /.git, a non-bare repository is assumed.
  • If the remote URL does NOT end with /.git, a bare repository is assumed.
原创粉丝点击