Domanda

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.

È stato utile?

Soluzione

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"

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top