Search code examples
gitmirrorgit-clonegit-remotegit-fetch

How to update a git clone --mirror?


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!


Solution

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

    git remote update