git 基本命令

@font-face{ font-family:"Times New Roman"; } @font-face{ font-family:"宋体"; } @font-face{ font-family:"Calibri"; } p.MsoNormal{ mso-style-name:正文; mso-style-parent:""; margin:0pt; margin-bottom:.0001pt; mso-pagination:none; text-align:justify; text-justify:inter-ideograph; font-family:Calibri; mso-fareast-font-family:宋体; mso-bidi-font-family:'Times New Roman'; font-size:10.5000pt; mso-font-kerning:1.0000pt; } span.msoIns{ mso-style-type:export-only; mso-style-name:""; text-decoration:underline; text-underline:single; color:blue; } span.msoDel{ mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red; } @page{mso-page-border-surround-header:no; mso-page-border-surround-footer:no;}@page Section0{ margin-top:72.0000pt; margin-bottom:72.0000pt; margin-left:90.0000pt; margin-right:90.0000pt; size:595.3000pt 841.9000pt; layout-grid:15.6000pt; } div.Section0{page:Section0;}

一.拉取/提交代码,并推送到服务器。合并代码

git pull  拉取代码

git commit -m “提交的描述

git push 推送到服务端

git checkout dev-main-1.0.0  切换到dev-main-1.0.0分支

git merge dev-main-1.0.0  dev-main-1.0.0分支合并到当前分支

 

二.更换git仓库地址

更换git地址:git remote set-url origin http://192.168.x.xxx/git/xxxxx/xxxxx-web.git

 

三.创建本地分支并关联远端

git fetch 更新远端分支到本地

git checkout dev-new-branch 切换到新分支

git checkout -b dev-new-branch_my 基于当前分支创建并切换到自己分支dev-new-branch_my

git push origin dev-new-branch_my:dev-new-branch_my 将自己分支推送到远端 (本地:远端)

git branch --set-upstream-to origin/dev-new-branch_my 将本地dev-new-branch_my分支关联远端dev-new-branch_my分支

 

四.拉取远端分支到本地并关联

git fetch origin 拉取远端所有分之提交 
git fetch origin master:dev 拉取远端分支到本地分支dev 

git branch -a 查看拉取到本地的分支列表 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章