Skip to content

Instantly share code, notes, and snippets.

@JoshuaEstes
Created February 3, 2011 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshuaEstes/810419 to your computer and use it in GitHub Desktop.
Save JoshuaEstes/810419 to your computer and use it in GitHub Desktop.
A co-worker is a GOD of men, I challenged him to use one line a command to take files for a current git project and push those to a remote server. This is what he came up with.
git archive --format=tar HEAD | ssh username@server tar xf - -C /path/to/folder
@JoshuaEstes
Copy link
Author

There needs to be a bit more about what was going on. We use gitolite to manage our repos and our staging server has many users that can ssh into. Instead of giving the staging server read only access to all the repos, this was what we came up with. It may or may not be the best solution, but it's a neat little trick that you can use and thought others may find it useful or may know of a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment