zoukankan      html  css  js  c++  java
  • push to deploy

    1.server端

    建立裸仓

    $ mkdir ~/repo.git
    $ cd ~/repo.git
    $ git init --bare

    脚本

    $ vim ~/repo.git/hooks/post-receive
    #!/bin/sh
    git --work-tree=~/htdocs --git-dir=~/repo.git checkout -f
    echo "Hooray, the new version is published!"
    $ chmod +x ~/repo.git/hooks/post-receive

    ***复制仓库,如果是已有代码的,直接从server代码处git clone到本地来,跳过下步

    $ git clone ~/repo.git ~/htdocs

    2.client端

    $ git remote add live ssh://your_username@your_hostname.tld/~/repo.git

    已经好了,使用时直接push同步到server,如下:

    $ git commit -m "your commit message"
    $ git push live master

    来源:https://ma.ttias.be/simple-git-push-workflow-deploy-code-server/

  • 相关阅读:
    观光公交
    luogu 4779 【模板】
    最小生成树(luogu 3366)
    计算系数
    更新区间,求单点—— luogu 3368
    HDU
    HDU
    HDU
    HDU
    BFS
  • 原文地址:https://www.cnblogs.com/fenle/p/5387653.html
Copyright © 2011-2022 走看看