1

I'm locally working on a project, and pushing everything to a remote repository. I've recently found that my hosting provider offers a git client, so instead of generating and applying patches once in a while (I've SSH access) I could use that. Cloning the repository isn't the good way because:

  1. It copies the whole thing every time;
  2. Some files are edited after the copy (a couple of configurations).

What would be the best way to do this?

(Is there a way to have just the files without the .git folder?)

entropid
  • 6,130
  • 5
  • 32
  • 45

2 Answers2

2

You could look into shallow clone. Something like this:

git clone --depth <n> <url>

with a post-receive hook on the server to edit the configurations.

Check out shallow cloning and git hooks.
Some combination of those should achieve what you're looking for.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Matthew Lehner
  • 3,967
  • 3
  • 26
  • 35
0

Not sure if I get this, but is this what you're looking for?

git archive HEAD | gzip > export.tar.gz
farnsworth
  • 349
  • 3
  • 13