30.git上线常用

发表于 未分类 分类,标签:
# 设置仓库
git init    #创建或初始化仓库
git fetch --all    #强制拉取所有分支
git config --global user.name "lei"
git config --global user.email "lmor@qq.com"
git remote add origin git@github.com:slbu/m.lbu.com.git
git clone git@github.com:slbu/m.lbu.com.git m.lbu.cn
# 上传代码
git add --all
git commit -m  "提交记录"
git push --set-upstream origin develop
# 切换分支版本
git  reset --hard 版本号
git reflog
git reset --hard d4e5f6g 切回最新版本HEAD@{1}
# 取消git追踪
git rm --cached -r devopsapi/
# 本地文件不提交仓库
git update-index --assume-unchanged devopsapi/settings.py
# 查看
git ls-files -v | grep '^h'
# 取消设置不提交仓库
git update-index --no-assume-unchanged devopsapi/settings.py
# 在github添加ssh密匙
ssh-keygen -t rsa -b 4096 -C "lmor@qq.com" -f ~/.ssh/id_rsa_shileide
vim ~/.ssh/config
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_shileide
# push代码
git add .
git commit -m "修改信息"
git push origin main
# 重置地址
git remote set-url origin git@gitee.com:lbucn/maon_vue.git
# 删除分支
git branch -d master
# 使用git的方式替换https
git config --global user.name "lei"
git config --global url."git@lab.yaozh.com:".insteadof "
# 修改仓库地址
git remote remove origin
git remote add origin  git@ctlab.yaozh.com:yaozh/news.git

# 拉预发布
git fetch --all
git checkout -b master origin/master
git reset --hard origin/master
git pull origin master
# 拉测服
git fetch --all
git checkout -b develop origin/develop
git reset --hard origin/develop
git pull origin develop

db
find /data/wwwroot/database.yaozh.com -type d -exec chmod 750 {} \;
find /data/wwwroot/database.yaozh.com ! -type d -exec chmod 640 {} \;
chown -R www:www /data/wwwroot/database.yaozh.com
chown -R root:root /data/wwwroot/database.yaozh.com/.git
chmod 700 /data/wwwroot/database.yaozh.com/.git
chmod -R -w /data/wwwroot/database.yaozh.com
chmod +w /data/wwwroot/database.yaozh.com/robots.txt
chmod -R +w /data/wwwroot/database.yaozh.com/uploads
chmod -R +w /data/wwwroot/database.yaozh.com/Application/Runtime
chmod -R +w /data/wwwroot/database.yaozh.com/sitemap
chmod +w /data/wwwroot/database.yaozh.com/Public/Uploads/nav_icon
chmod +w /data/wwwroot/database.yaozh.com/Public/Uploads/exceldata
chown -R root:root /data/wwwroot/database.yaozh.com/vendor/composer/installed.json
chown -R root:root /data/wwwroot/database.yaozh.com/package-lock.json
chown -R root:root /data/wwwroot/database.yaozh.com/composer.json

vip
chown -R www:www /data/wwwroot/vip.yaozh.com
chown -R root:root /data/wwwroot/vip.yaozh.com/.git
chmod 700 /data/wwwroot/vip.yaozh.com/.git
vipapi
find /data/wwwroot/vipapi.yaozh.com -type d -exec chmod 750 {} \;
find /data/wwwroot/vipapi.yaozh.com ! -type d -exec chmod 640 {} \;
chown -R www:www /data/wwwroot/vipapi.yaozh.com
chown -R root:root /data/wwwroot/vipapi.yaozh.com/.git
chmod 700 /data/wwwroot/vipapi.yaozh.com/.git
chmod -R -w /data/wwwroot/vipapi.yaozh.com
chmod -R +w /data/wwwroot/vipapi.yaozh.com/runtime
chmod -R +w /data/wwwroot/vipapi.yaozh.com/public/upload
chmod -R +w /data/wwwroot/vipapi.yaozh.com/extend/mpdf
大版本更新清理缓存
https://vip.yaozh.com/api/Handle/dbCacheDel?dbnamestr=all

www
chown -R root:root /data/wwwroot/www.yaozh.com/.git
chmod 700 /data/wwwroot/www.yaozh.com/.git

appapi
find /data/wwwroot/appapi.yaozh.com -type d -exec chmod 750 {} \;
find /data/wwwroot/appapi.yaozh.com ! -type d -exec chmod 640 {} \;
chown -R www:www /data/wwwroot/appapi.yaozh.com
chown -R root:root /data/wwwroot/appapi.yaozh.com/.git
chmod 700 /data/wwwroot/appapi.yaozh.com/.git
chmod -R -w /data/wwwroot/appapi.yaozh.com
chmod -R +w /data/wwwroot/appapi.yaozh.com/runtime
chmod -R +w /data/wwwroot/appapi.yaozh.com/public/upload

qx
chown -R www:www /nfs/wwwroot/qx.yaozh.com
chown -R root:root /nfs/wwwroot/qx.yaozh.com/.git
chmod 700 /nfs/wwwroot/qx.yaozh.com/.git
qxapi
find /nfs/wwwroot/qxapi.yaozh.com -type d -exec chmod 750 {} \;
find /nfs/wwwroot/qxapi.yaozh.com ! -type d -exec chmod 640 {} \;
chown -R www:www /nfs/wwwroot/qxapi.yaozh.com
chown -R root:root /nfs/wwwroot/qxapi.yaozh.com/.git
chmod 700 /nfs/wwwroot/qxapi.yaozh.com/.git
chmod -R -w /nfs/wwwroot/qxapi.yaozh.com
chmod -R +w /nfs/wwwroot/qxapi.yaozh.com/runtime

report
mkdir -p /nfs/wwwroot/report.yaozh.com/public/sitemap
find /nfs/wwwroot/report.yaozh.com -type d -exec chmod 750 {} \;
find /nfs/wwwroot/report.yaozh.com ! -type d -exec chmod 640 {} \;
-
chown -R www:www /nfs/wwwroot/report.yaozh.com
chown -R root:root /nfs/wwwroot/report.yaozh.com/.git
chmod 700 /nfs/wwwroot/report.yaozh.com/.git
-
chmod -R -w /nfs/wwwroot/report.yaozh.com
chmod -R +w /nfs/wwwroot/report.yaozh.com/runtime
chmod -R +w /nfs/wwwroot/report.yaozh.com/public/upload
chmod -R +w /nfs/wwwroot/report.yaozh.com/public/reportSet
chmod -R +w /nfs/wwwroot/report.yaozh.com/public/getCatAll.json
chmod -R +w /nfs/wwwroot/report.yaozh.com/public/getCatSelect.json
chmod -R +w /nfs/wwwroot/report.yaozh.com/public/sitemap

patent
chown -R www:www /data/wwwroot/patent.yaozh.com
chown -R root:root /data/wwwroot/patent.yaozh.com/.git
chmod 700 /data/wwwroot/patent.yaozh.com/.git
patapi
无



0 篇评论

发表我的评论