• 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 push --set-upstream origin dev-new-branch_my 
    或 git push -u origin dev-new-branch_my //将本地的分支与远程仓库的分支进行关联

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

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

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

    五. 更新远端分支

    git remote update origin --prune
    git remote update origin -p

    六. 删除本地/远端分支

    删除本地分支

    git branch -d branchName

    删除远端分支

    git push origin --delete branchName
  • 相关阅读:
    所谓的日常 #8
    所谓的日常 #7
    所谓的日常 #6
    所谓的日常 #5
    所谓的日常 #4
    所谓的日常 #3
    DFS序+线段树 hihoCoder 1381 Little Y's Tree(树的连通块的直径和)
    Codeforces Round #366 (Div. 2)
    2016 Multi-University Training Contests
    DP套DP HDOJ 4899 Hero meet devil(国王的子民的DNA)
  • 原文地址:https://www.cnblogs.com/juexin/p/11230651.html
Copyright © 2020-2023  润新知