How to update a git clone --mirror?

J. Bruni picture J. Bruni · May 27, 2011 · Viewed 147.1k times · Source

I have created a git repository to mirror a live site (which is a non-bare git repository):

git clone --mirror ssh://[email protected]/path/to/repo

Now, to keep this mirror clone updated with all changes from its remote origin, which command or commands I must use?

I'd like to keep everything updated: commits, refs, hooks, branches, etc.

Thanks!

Answer

ralphtheninja picture ralphtheninja · May 27, 2011

This is the command that you need to execute on the mirror:

git remote update