工作中常用命令(git和k8s)
生活随笔
收集整理的這篇文章主要介紹了
工作中常用命令(git和k8s)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
GIT
在本地分支.上開發
向GitLab提交代碼
分支獲取最新代碼
git fetchgit merge origin/mastergit push origin HEAD: huangjialin-alter-some-codes強制拉取并覆蓋本地代碼
git fetch --allgit reset --hard origin/ mastergit pullgit pull 和 git fetch的區別?
https://www.zhihu.com/question/38305012
master獲取最新代碼
git checkout master git pull沖突解決
有時testing項目會拒絕commit,如果確定自己的代碼格式沒有問題,則可以選擇使用以下命令進行強制提交
git commit -m "提交信息" -n本地分?push到遠程master時可能會出現落后遠程分?拒絕push的提?,則可以嘗試以下命令進? 強制提交
git push origin HEAD:<remote_branch_name> -f遠程代碼合并操作匯總
~/business-directory jialin-check-function > git checkout master ... ~/business-directory master > git pull ... ~/business-directory master > git checkout jialin-check-function .... ~/business-directory jialin-check-function > git merge origin/master ... ~/business-directory jialin-check-function > git status 4s py infra_test:infra_test 3.8.7 16:43:04 位于分? jialin-check-function ??件要提交,?凈的?作區 ~/business-directory jialin-check-function > git merge origin/master py infra_test:infra_test 3.8.7 16:43:10 已經是最新的。進?以上操作即可完成本地分?與遠程分?的合并
git 回退到某個commit
git log -3 #查看最新提交的三個版本號 git reset --hard HEAD^ #回退到上個版本 git reset --hard HEAD~3 #回退到前3次提交之前,以此類推,回退到n次提交之前 git reset --hard commit_id #退到/進到指定commi t的sha碼強制清空本地commit
git stash git stash clear選擇stash
第?次stash:
> git stash查詢stash 列表:
> git stash list > stash@{0}: WIP on fixResponseType: 8ba2b28 add and change some logic 12第?次stash:
> git stash查詢stash 列表:
> git stash list stash@{0}: WIP on emcache: c13f985 Merge pull request #12 from username/fixRespo nseType stash@{1}: WIP on fixResponseType: 8ba2b28 add and change some logic可以看到 stash@{0} 是最新的緩存,stash@{1} 是第?次的stash,所以選擇指定的緩存恢復的操作如 下:
> git stash pop stash@{1}這個是恢復第?次的緩存
測試文件更新
在對應的api修改之后,如果進行測試需要更新其相應的測試文件
即在對應的分支下執行
K8S
重啟k8s
開啟成功后可訪問
https://local.develop.yaochn.com:8443/ https://local.develop.yaochn.com:9443/
此?法會清空本地數據庫
查看log?志
kubectl logs service/ auth-hub #查看對應項目的的log kubectl describe pod notificati on-77464c574-49bc7 #查看具體pod描述異常監控
jenkins.yaochn.com https://jenkins.yaochn.com/總結
以上是生活随笔為你收集整理的工作中常用命令(git和k8s)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 即插即用计算机自动识别,电脑向导未能检测
- 下一篇: 音频转换器评估:将音乐文件转换成MP3格