简体   繁体   中英

Mirror Git repositories with local changes

I would like to mirror a repository A to a repository B and make some changes on B while synchronizing all changes made to A in B. What's the best approach to do that ?

Currently, I use git-mirror to mirror the repo A and push to B. But when I fetch for new changes from A and push them to B, all my works on B (new branches) are deleted. I always get a copy of A.

Thanks in advance for your help.

The Git definition of a mirror is that it has no state of its own: it always replaces all of its information with the information from the site it's mirroring.

In other words, if B is a mirror of A, and you put something on B without putting it on A first, it will just vanish from B. Never put anything onto B; put it onto A, and it will mirror to B on the next mirror-update.

(If this is not the behavior you want, you do not want a mirror.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM