/ walking bear:D / 用 git 同步幾台電腦的 repository

用 git 同步幾台電腦的 repository

2017-04-02 posted in []

持續整合新的功能,優化工作流程。 參考這篇:git repository sync between computers, when moving around?

目前有兩台電腦,F-107 用來開發新功能、測試。 另一台 K-112 則是作為 running / production server。

在 K-112 執行下面命令,複製 F-107 的 repository

$ git clone wkliang@192.168.0.107:/home/wkliang/src/myproject 

再 checkout 到 running directory,先用 foreground 的方式執行 node app.js

修改 Makefile 加入 mongodb 的 dump and restore

dump:
        mongodump -d myproject -o dump/
restore:
        mongorestore -v --drop -d myproject dump/myproject/

. reply_count: 1 get_replies : 1 . 2017-04-06_06:39:39 smug886 在目標機器 K-112 建立另一個執行目錄,區隔正在執行中的版本、以及開發中的版本:

$ mkdir 20170406
$ cd 20170406
$ git --git-dir=../src/myproject/.git --work-tree=. checkout

參考這篇:git checkout branch from outside .

walking bear:DRSS feed

关于

wkliang

Clarke's Three Laws:

  • When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
  • The only way of discovering the limits of the possible is to venture a little way past them into the impossible.
  • Any sufficiently advanced technology is indistinguishable from magic.
  • 版权申明

    知识共享许可协议

    Fork me on GitHub

    Powered by

    Disqus, GitHub, Google Custom Search, Gravatar, HighlightJS, jekyll