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.

  • Puppet exec command runs in shell, but not via puppet
  • Can I implement my own Python-based git merge strategy?
  • How to “rename” a file in Git after already having moved it with bash/mv
  • pod install returns fatal error: SSL certificate issue?
  • Git: Preventing Commit During a Rebase
  • How to rebase off master with github client?
  • How to keep your git fork clean from duplicate commits?
  • Managing and viewing branches in a GIST
  • Git refusing push (behind remote counterpart)
  • How do I squash and edit the same commit?
  • Recover staged but not committed files after 'git rm -rf'
  • Git DOES NOT require username and password. How can I change it to do so?
  • One Solution collect form web for “clone repository without commits”

    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
    Git Baby is a git and github fan, let's start git clone.