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

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

  •  
  •   xx0219 · Jan 26, 2017 · 4035 views
    This topic created in 3382 days ago, the information mentioned may be changed or developed.

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

    据说 coding 不错....

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

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

    Supplement 1  ·  Jan 28, 2017

    .. 才发现 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 replies    2017-01-27 12:48:44 +08:00
    MajestySolor
        1
    MajestySolor  
       Jan 26, 2017   ❤️ 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  
       Jan 26, 2017   ❤️ 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  
       Jan 26, 2017
    当手册用直接部署在本地得了
    lslqtz
        4
    lslqtz  
       Jan 26, 2017 via iPhone
    coding 用 github 自动部署更新
    phrack
        5
    phrack  
       Jan 27, 2017 via Android
    bash 脚本应该就可以啊,两个 git push 不就完事了?
    taoyu1994x
        6
    taoyu1994x  
       Jan 27, 2017 via Android
    楼主是觉得两个 git push 太 low ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2401 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 02:10 · PVG 10:10 · LAX 19:10 · JFK 22:10
    ♥ Do have faith in what you're doing.