Вопрос

I know that you can run git clone -n git@repo to clone without checking out files, but is it possible to clone a repository without even pulling the refs?

For example, if I had a repository that I wanted to create a placeholder for I could this:

mkdir repo
cd repo
git init
git remote add origin git@repo

Then everything would be in place so that I could pull at a later date.

Это было полезно?

Решение

You only can add some initialization config steps like:

git init repo
cd repo
git remote add origin git@repo

git config user.name yourName
git config user.email yourEmail
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

Then everything would be ready for a git fetch.

This is similar to this Gist script "remgit.sh"

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top