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/
push to deploy的更多相关文章
- 初遇 dotcloud
逛园子的时候看到新浪SAE,正学习建站呢,好东西.(论环境的影响...) 不过发现新浪SAE只支持 Python2,我更喜欢 Python3 e...找找其他的,发现了 dotcloud,遂试试,下面 ...
- 从零开始,做一个NodeJS博客(一):Heroku上的最简NodeJS服务器
标签:NodeJS,Heroku 0 这里是这个伪系列的第一篇,因为我也不知道自己能不能做完,然后到底能做成什么样子.总之,尽力而为吧,加油. 1 Heroku App 的构成 Heroku 所谓的 ...
- 使用Skaffold一键将项目发布到Kubernetes
当前skaffold版本为v0.4,还未发布正式版本,不建议在生产环境中使用: skaffold用于开发人员快速部署程序到Kubernetes中:skaffold提供了dev.run两种模式:使用sk ...
- 【git】git简单使用教程
git的简单使用教程: 1.安装git bash客户端 2.打开git bash,cd到需要存储代码的路径下, 执行:git clone -b deploy ssh://git@gitlab.xxxx ...
- 【高可用架构】借助Envoy工具发布项目到多台服务器
前言 在上一篇,我们已经成功在开发机上部署了Deploy项目,下面我们继续在开发机上安装Envoy 两台应用服务器的IP 192.168.10.12 192.168.10.18 [高可用架构]系列链接 ...
- Salesforce LWC学习(一)Salesforce DX配置
LWC: Create a Salesforce DX Project and Lightning Web Component:https://www.youtube.com/watch?v=p268 ...
- Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-slave(二)
一.说明 1.1 说明 前面介绍采用 Jenkinsfile + KubernetesPod.yaml 方式进行部署项目(Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-s ...
- Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-slave(一)
一.说明 1)需求: Rancher 上部署 Jenkins-master,服务采用 Jenkins-slave 发布,发布完成后 Jenkins-slave 自动销毁. 2)环境: Rancher ...
- Windows docker k8s asp.net core
在上一篇文章 Ubuntu 18 Kubernetes的Install and Deploy 我们在ubuntu在部署了k8s集群, 今天来看看windows下怎么搞. 主要点有: 1) window ...
随机推荐
- hdu 4003 树形dp+分组背包 2011大连赛区网络赛C
题意:求K个机器人从同一点出发,遍历所有点所需的最小花费 链接:点我 Sample Input 3 1 1 //3个点,从1出发,1个机器人 1 2 1 1 3 1 3 1 2 1 2 1 1 3 1 ...
- Sonar+Hudson+Maven构建系列之三:安装Hudson
摘要:其实前面介绍过Sonar,后面Hudson安装就方便了.安装Hudson之前说说Hudson相关的事,现在世面上的有两种与Hudson相关的CI工具,一个是Hudson,一个是Jenkins,这 ...
- PHPExcel 类
//引入工具类 require_once 'PHPExcel.php'; //HandleExcel.class.php 文件 class HandleExcel extends PHPExcel{ ...
- AppInventor学习笔记(二)——Hello Purr
一.设计组件 1.定义: 就是WPF中的控件一个意思,直接调用不需要知道怎么写的,只需要写响应函数即可. 2.Designer: (1)界面如下: (2)分区: ①预览窗口: 用于放置应用中所需的组件 ...
- 【部分原创】标准C语言的优先级、结合性、求值顺序、未定义行为和非确定行为浅析
零. 优先级 在C++ Primer一书中,对于运算符的优先级是这样描述的: Precedence specifies how the operands are grouped. It ...
- Rotating Sentences
#include<bits/stdc++.h> #define N 110 int main(void) { char s[N][N]; int i, j, k, max; , memse ...
- Properties类的用法
在java.util包下面有一个类Properties,该类主要用于读取以项目的配置文件(以.properties结尾的文件和xml文件). 一. Properties结构 类继承结构如下: clas ...
- ural 1306. Sequence Median
1306. Sequence Median Time limit: 1.0 secondMemory limit: 1 MBLanguage limit: C, C++, Pascal Given a ...
- Open the Lock[HDU1195]
Open the Lock Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- html5中manifest特性测试
测试环境和工具 chromium 18.0.1025.151 (开发编译版 130497 Linux) Ubuntu 11.04 一.测试内容 1.A页面manifest缓存的js文件,B页面不 ...