git-sync-web 自动提交 2026-09-08 17:26:59
This commit is contained in:
@@ -446,8 +446,7 @@ func (e *Engine) setOK(s *repoState, detail string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensureRemotes 把配置中的远程同步到仓库(缺失则添加,URL 变化则更新)
|
// ensureRemotes 把配置中的远程同步到仓库(缺失则添加,URL 变化则更新)
|
||||||
func (e *Engine) ensureRemotes(s *repoState, cfg *RepoConfig) {
|
func (e *Engine) ensureRemotes(s *repoState, cfg *RepoConfig) { for _, r := range cfg.Remotes {
|
||||||
for _, r := range cfg.Remotes {
|
|
||||||
out, err := gitRun(cfg.RepoPath, 15*time.Second, "remote", "get-url", r.Name)
|
out, err := gitRun(cfg.RepoPath, 15*time.Second, "remote", "get-url", r.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if _, aerr := gitRun(cfg.RepoPath, 15*time.Second, "remote", "add", r.Name, r.URL); aerr != nil {
|
if _, aerr := gitRun(cfg.RepoPath, 15*time.Second, "remote", "add", r.Name, r.URL); aerr != nil {
|
||||||
|
|||||||
@@ -52,3 +52,10 @@ error: failed to push some refs to 'https://git.shiroko.one/tamakyi/github-auto-
|
|||||||
[2026-09-08 17:24:34] === 同步完成(本地领先 0,落后 0)===
|
[2026-09-08 17:24:34] === 同步完成(本地领先 0,落后 0)===
|
||||||
[2026-09-08 17:25:34] === 开始同步(定时检查,模式 push)===
|
[2026-09-08 17:25:34] === 开始同步(定时检查,模式 push)===
|
||||||
[2026-09-08 17:25:42] 检测到 3 个未提交改动,执行自动提交
|
[2026-09-08 17:25:42] 检测到 3 个未提交改动,执行自动提交
|
||||||
|
[2026-09-08 17:25:46] 自动提交完成,将随本轮同步推送
|
||||||
|
[2026-09-08 17:25:48] 远程分支 origin/main 不存在(远程仓库可能为空或分支名不一致),将推送本地 8 个提交以建立远程分支
|
||||||
|
[2026-09-08 17:25:49] 推送至 origin 失败: error: src refspec main does not match any
|
||||||
|
error: failed to push some refs to 'https://git.shiroko.one/tamakyi/github-auto-sync-golang'
|
||||||
|
[2026-09-08 17:25:50] === 同步完成(本地领先 0,落后 0)===
|
||||||
|
[2026-09-08 17:26:50] === 开始同步(定时检查,模式 push)===
|
||||||
|
[2026-09-08 17:26:58] 检测到 3 个未提交改动,执行自动提交
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ timestamp,action,result,commits
|
|||||||
2026-09-08 17:21:58,push,failed,5
|
2026-09-08 17:21:58,push,failed,5
|
||||||
2026-09-08 17:23:16,push,failed,6
|
2026-09-08 17:23:16,push,failed,6
|
||||||
2026-09-08 17:24:33,push,failed,7
|
2026-09-08 17:24:33,push,failed,7
|
||||||
|
2026-09-08 17:25:49,push,failed,8
|
||||||
|
|||||||
|
Reference in New Issue
Block a user