entropid
entropid

Reputation: 6239

Git: pull from repository, remotely

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?)

Upvotes: 1

Views: 173

Answers (2)

Matthew Lehner
Matthew Lehner

Reputation: 4027

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.

Upvotes: 2

farnsworth
farnsworth

Reputation: 349

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

git archive HEAD | gzip > export.tar.gz

Upvotes: 0

Related Questions