Specify the repository to track. This can be a URL or a local file path.
Note that for super-projects (repositories with submodules), only a local file
path or a complete URL is valid. The following are examples of valid git URLs.
- ssh://git@github.com/github/git.git
- git@github.com:github/git.git (short notation for ssh protocol)
- ssh://user@other.host.com/~/repos/R.git (to access the repos/R.git
repository in the user's home directory)
- https://github.com/github/git.git
- git://github.com/github/git.git
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.
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.