目标仓库可以不存在,但是存在的仓库必须关闭分支保护或者将分支保护配置为允许强制推送
you can download the latest binary release here
go get github.com/DockerContainerService/git-syncer
cd ${GOPATH}/github.com/DockerContainerService/git-syncer
make all
[root@tencent ~]# ./git-syncer -h
Usage:
git-syncer [flags]
Flags:
-c, --config string config file
-d, --debug enable debug mode
-h, --help help for git-syncer
--privateKeyFile string private key file
-p, --proc int numbers of worker (default 5)
-r, --retries int times to retry failed task (default 3)
{
"[email protected]:DockerContainerService/git-syncer.git": "[email protected]:demo/git-syncer.git"
}
$ ./git-syncer -c test.json
[2023-05-11 19:54:55] INFO Generate task syncTask-git-syncer.git: [email protected]:DockerContainerService/git-syncer.git => [email protected]:demo/git-syncer.git
[2023-05-11 19:54:55] INFO Run task syncTask-git-syncer.git: [email protected]:DockerContainerService/git-syncer.git => [email protected]:demo/git-syncer.git
[2023-05-11 19:55:20] WARN Retry task syncTask-git-syncer.git, times 1
[2023-05-11 19:55:45] WARN Retry task syncTask-git-syncer.git, times 2
[2023-05-11 19:56:10] WARN Retry task syncTask-git-syncer.git, times 3
[2023-05-11 19:56:35] ERROR Run task syncTask-git-syncer.git [email protected]:DockerContainerService/git-syncer.git => [email protected]:demo/git-syncer.git err: dial tcp 172.17.162.204:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[2023-05-11 19:56:35] INFO Finished, 0 task succeeded, 1 task failed. failed task list:
syncTask-git-syncer.git: [email protected]:DockerContainerService/git-syncer.git => [email protected]:demo/git-syncer.git, err: dial tcp 172.17.162.204:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.