ccmingchao
V2EX  ›  Synology

可以实现自动化备份 git 仓库吗?

  •  
  •   ccmingchao · Sep 24, 2024 · 3133 views
    This topic created in 649 days ago, the information mentioned may be changed or developed.

    想法:gitserver 在其他计算机或者公网上,提供 git 服务。 在群晖上,装 git 客户端(或者其他软件)。定时备份 Git 仓库? 有这样的软件吗?

    6 replies    2024-09-26 14:48:44 +08:00
    KagurazakaNyaa
        1
    KagurazakaNyaa  
       Sep 24, 2024
    你 docker 跑个 gitea 然后在上面创建镜像仓库不就行了?
    ohiomiky
        2
    ohiomiky  
       Sep 24, 2024
    写个脚本都用不了 10 行
    kuxuan
        3
    kuxuan  
       Sep 24, 2024
    写个 crontab 定时任务
    ccmingchao
        4
    ccmingchao  
    OP
       Sep 24, 2024
    不在群晖上装 gitea 。或者 gitserver ,有办法吗?
    JerryYuan
        5
    JerryYuan  
       Sep 24, 2024 via Android
    @ccmingchao crontab ,定时去仓库里 git fetch origin ,不过还是装个 gitlab/gitea 之类的托管平台自动同步更方便。gitlab 嫌大可以装 gitea ,90%的功能,资源占的也少一些。
    hsmbl
        6
    hsmbl  
       Sep 26, 2024
    win 上跑的,参考下。
    run.bat
    schtasks /create /tn "自动提交 doc" /tr "D:\my-doc-folder\jjh_doc\auto_commit_push.bat" /sc daily /st 11:25

    auto_commit_push.bat
    d:
    cd D:\my-doc-folder\jjh_doc
    git add * -f
    git commit -m "c"
    git push
    Pause
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   871 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 20:49 · PVG 04:49 · LAX 13:49 · JFK 16:49
    ♥ Do have faith in what you're doing.