In a bare repository, is it safe to push (to another repos) while pushes are being done (to that repo)?
Reason I am asking this is that in a project I worked on I saw a weird git replication schema: in the post-receive hook of the main repo (that repo is bare), the replicas are asked (in background) to do a git fetch
. Replicas are bare repositories also. I was told that if the post receive hook just initiated a git push
in background the references in the replicas ended with the wrong values if users kept pushing to the main repo in the meanwhile.
Since I want to setup a replica schema for another project, I was wondering about the reason behind the push schema failing (I need little replication lag, but I don't want post-receive hook taking too long, as it would do with synchronous pushes to all replicas).
Is any local data (I am thinking objects/pack/*
or packed-refs
) modified while receiving data and used while pushing? I cannot think of other reasons
first of all check your remote
git remote -v
then check the repo is same as your repo or not if not remove it
git remove upstream
then set your upstream
git set upstream then is worked fine you will be able to push and pull
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.