????????????????????構(gòu)建項(xiàng)目 遠(yuǎn)端步驟 使用環(huán)境 windows開發(fā) linux測試
1.?初始化遠(yuǎn)程代碼版本庫? git init --bare xx.git??????
? ?????在相應(yīng)的 gitRepo 里執(zhí)行 此命令 構(gòu)建裸版本庫 example: git init --bare swoole.git
2.代碼來自于公共的版本庫. git clone /root/gitRepo/xx.git
? ? ? ? 在相應(yīng)的web服務(wù)器 下的 html.htdocs 拉取公共版本庫的代碼 同一臺系統(tǒng)上克隆直接使用版本庫地址即可? ?git clone /root/gitRepo/swoole.git
3.本地開發(fā)環(huán)境 克隆拉取公共版本庫的代碼? git clone ssh://root@xx.xx.xx.xx:80/root/gitRepo/xx.git
? ? ? ? 本地開發(fā)環(huán)境 克隆執(zhí)行 拉取公共版本庫 替換成真實(shí)的 ip地址 和 端口?
? ???????git clone ssh://root@ip:port/root/gitRepo/swoole.git
4.本地提交代碼
? ? ? ? git add .?
? ? ? ? git commit -m 'xxxxxxxxxxxxxxx;
? ? ? ? git push origin master?
5.使用最新提交的代碼 防止提交的代碼存在沖突
? ??????git fetch --all
????????git reset --hard origin/master
? ? ? ? git pull
6.同一遠(yuǎn)程服務(wù)器 需要提交代碼?
需要配置 git 配置 name email 可隨意指定?
?git config --global user.email you@example.com
?git config --global user.name "Your Name"
使用 git add .
git commit -m 'XXXX'
git push?