What does the “.git” mean in a git URL?

后端 未结 4 1519
名媛妹妹
名媛妹妹 2021-02-20 02:06

I setup a git repo in foo

cd
mkdir foo
cd foo
git init

Now I want to reference that remotely

git clone git+ssh://me@somemachine         


        
4条回答
  •  孤城傲影
    2021-02-20 03:07

    The .git suffix is just convention to indicate that the directory in question is a bare git repository (ie, one in which there is no working copy). It's not actually required.

    As for git+ssh://, according to the git-fetch manpage, it is not allowed:

    Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols. The following syntaxes may be used with them:

    • ssh://[user@]host.xz[:port]/path/to/repo.git/
    • git://host.xz[:port]/path/to/repo.git/
    • http[s]://host.xz[:port]/path/to/repo.git/
    • ftp[s]://host.xz[:port]/path/to/repo.git/
    • rsync://host.xz/path/to/repo.git/

       An alternative scp-like syntax may also be used with the ssh protocol:>

    • [user@]host.xz:path/to/repo.git/

提交回复
热议问题