V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ccmingchao
V2EX  ›  Synology

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

  •  
  •   ccmingchao · Sep 24, 2024 · 2764 views
    This topic created in 583 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   ·   5633 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 06:30 · PVG 14:30 · LAX 23:30 · JFK 02:30
    ♥ Do have faith in what you're doing.