V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xx0219
V2EX  ›  问与答

求双线部署方案.... github + coding

  •  
  •   xx0219 · 2017-01-26 18:28:57 +08:00 · 3021 次点击
    这是一个创建于 2649 天前的主题,其中的信息可能已经有所发展或是发生改变。

    .... github 实在太慢了... 特别是我拿博客当手册使用的.速度自然越快越好...

    据说 coding 不错....

    但是有没有办法 能同时部署本地的某个文件夹 到 github 和 coding 的 ?????

    不想 github 这边发布一次, 再去 coding 发布一次.. 太 low 了.....

    第 1 条附言  ·  2017-01-28 11:27:28 +08:00

    .. 才发现 coding 也是可以用 gui工具的 ....
    我这用 tower 做演示(本身github可以正常推送)...

    1. 首先获取 github的 url url = https://github.com/Xu-Jian/Xu-Jian.github.io.git

    2. 然后获取 coding的url url = https://git.coding.net/xx0219/xx0219.coding.me.git

    3. Coding的url 需要处理下. https:// 后面加上 用户名@ url = https://[email protected]/xx0219/xx0219.coding.me.git

    4. 其实 .git是个隐藏文件夹. 我一直以为是个文件..... -.-

    用命令添加也好. 还是直接打开本地目录下的 .git/config 也好.. 最终 git/config 变成下面格式就对了. 其他都不用管,其实就是多了 最下面的4行!!!! 第一行 all 是名字而已(推送的时候 有好几个选项的.选择这个名字就可以). 然后就 可以推送了!!!!

    [core] bare = false filemode = true precomposeunicode = true logallrefupdates = true [core] repositoryformatversion = 0 [remote "Github"] url = https://github.com/Xu-Jian/Xu-Jian.github.io.git fetch = +refs/heads/:refs/remotes/origin/ [branch "master"] remote = origin merge = refs/heads/master

    [remote ""Github&Coding""] url = https://github.com/Xu-Jian/Xu-Jian.github.io.git fetch = +refs/heads/:refs/remotes/all/ url = https://[email protected]/xx0219/xx0219.coding.me.git

    1. 随便改个文件 → commit → push push 肯定有 选项的. 第一次的话.请把 force push 打勾.. 不然会报错(虽然好像报错也能两边都推送....)

    1. 然后去 github 和 coding 两边应该都成功推送了....
    6 条回复    2017-01-27 12:48:44 +08:00
    MajestySolor
        1
    MajestySolor  
       2017-01-26 18:44:18 +08:00   ❤️ 3
    git/config 里这样写

    [remote "github"]
    url = [email protected]:aaa/bbb.git
    fetch = +refs/heads/*:refs/remotes/github/*
    [remote "coding"]
    url = [email protected]:aaa/bbb.git
    fetch = +refs/heads/*:refs/remotes/coding/*
    [remote "all"]
    url = [email protected]:aaa/bbb.git
    url = [email protected]:aaa/bbb.git

    然后 push all 就是直接推送到 github 和 coding
    不清楚这样是不是规范,我一直这样用好久了
    hwk603
        2
    hwk603  
       2017-01-26 19:04:26 +08:00   ❤️ 3
    添加同名多个远程仓库就好了:

    ```
    git remote add all https://github.com/yours/a.git
    git remote set-url --add all https://git.coding.net/yours/a.git
    git push all --all
    ```
    hanzichi
        3
    hanzichi  
       2017-01-26 21:47:07 +08:00
    当手册用直接部署在本地得了
    lslqtz
        4
    lslqtz  
       2017-01-26 23:41:43 +08:00 via iPhone
    coding 用 github 自动部署更新
    phrack
        5
    phrack  
       2017-01-27 11:34:12 +08:00 via Android
    bash 脚本应该就可以啊,两个 git push 不就完事了?
    taoyu1994x
        6
    taoyu1994x  
       2017-01-27 12:48:44 +08:00 via Android
    楼主是觉得两个 git push 太 low ?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1112 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:30 · PVG 02:30 · LAX 11:30 · JFK 14:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.