How to copy a git repository directly form remote server without .git directory and .gitignore files?. In advance from a tag name or branch.
You can use the command
git archive branchname
to archive files from a named tree. I.e. you can pass the output to tar
to pack the files or filter files like .gitignore
(.git
will not be exported):
git archive branchname | tar -x -C c:\git-my-branch
Checkout out git help archive
for more details.
The equivalent of svn export . otherpath
inside an existing repo is
git archive branchname | (cd otherpath; tar x)
The equivalent of svn export url otherpath
is
git archive --remote=url branchname | (cd otherpath; tar x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With