How to make a git clone without the . git repository?

Asked

Viewed 319 times

1

I have a repository where I keep my front-end files. I wanted to know a way to make a "git clone" of this Reset into a project folder (ex: a wordpress theme), so that only the files come without the folder ". git" (which would take care of versioning). And don’t create a new folder for Repo, but let the files come to my project root directory (alias my Working directory).

Actually I’m struggling to understand git with more approach "Plumbing Commands", but in the official document it is very hard/technical to understand. In the internet tutorials it is all very plastered and facing the simple. I’m looking for a middle ground so I can move forward.

Type, in my Ref I have my Sass project and my standard tasks with Gulp (that perfectly fit my demand for projects for internet) and this Code is intended to evolve always. But the idea is to come up with a git command where I can download the files from this link to a new project for q eu".

  • 1

    Do you want it by command line? Why not go straight to Github and download the zip and put it in the folder you want? Displays the hidden files and deletes the . git folder if it is there.... Sometimes this can help you https://answall.com/questions/356852/visual-studio-git-5000-changes/356914#356914

  • Per command line, because the intention is that I can automate with bash. I think I asked a very precise question about this.

  • @user7069 if you are cloning, you will need .git. The most standard would be for you to build and make it accessible to download. This is more explicit when you are doing something that needs to go through compilation before going into production, but can also be done in PHP.

1 answer

2

You can’t do that with the clone, but it’s possible with the archive or checkout-index:

git archive master | tar -x -C /somewhere/else

The git archive will create a package with committed code on your branch and then you can extract it with the tar.

git checkout-index -a -f --prefix=/destination/path/

The git checkout-index with the flag -a copies all files in the index and the -f force overwrite the files at destination if they already exist.

In the --prefix you set the path you want to copy your file. Note the last /, if you forget it your file will go to a wrong destination with a prefix called path.

Reference: https://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export/160719

Browser other questions tagged

You are not signed in. Login or sign up in order to post.