Patrick Maciel
Patrick Maciel

Reputation: 4944

clone repository without commits

I want clone specific repository of GitHub, but, without commits, branchs, in the other words: clone master branch and nothing more.

I know I can clone the repository and then just copy all the files except the .git folder, but wanted to know if this is possible.

Upvotes: 1

Views: 1510

Answers (1)

Michael Krelin - hacker
Michael Krelin - hacker

Reputation: 143081

You probably want something like

git clone -b master --single-branch --depth 1 elsewhere.git here

or maybe

git archive --remote somewhere.git master | tar -xvf - -C /where/i/want/to/put/it

Upvotes: 3

Related Questions