zoukankan      html  css  js  c++  java
  • gitlab分支管理

    分支


    git branch
    列出本地所有分支
    git branch (branchname) 创建一个新的分支
    git checkout (branchname) 切换分支

    *表示当前正在使用的分支
    git branch -d (branchname) 删除分支
    git branch //查看本地所有分支 
    
    git branch -r //查看远程所有分支
    
    git branch -a //查看本地和远程的所有分支
    
    git branch <branchname> //新建分支
    
    git branch -d <branchname> //删除本地分支
    
    git branch -d -r <branchname> //删除远程分支,删除后还需推送到服务器
    
    git push origin:<branchname>  //删除后推送至服务器
    
    git branch -m <oldbranch> <newbranch> //重命名本地分支

    标签

    发布一个版本时,我们通常先在版本库中打一个标签(tag),这样就唯一确定了打标签时刻的版本。将来无论什么时候,取某个标签的版本,就是把那个打标签的时刻的历史版本取出来。

    所以,标签也是版本库的一个快照。

    Git 的标签虽然是版本库的快照,但其实它就是指向某个 commit 的指针(跟分支很像对不对?但是分支可以移动,标签不能移动),所以,创建和删除标签都是瞬间完成的。

    创建标签

    git tag <tagName> //创建本地tag
    
    git push origin <tagName> //推送标签到远程仓库
    
    若存在很多未推送的本地标签,你想一次全部推送的话:
    
    git push origin --tags

    查看标签

    查看本地某个 tag 的详细信息:
    
    git show <tagName>
    
    查看本地所有 tag:
    
    git tag 或者 git tag -l
    
    查看远程所有 tag:
    
    git ls-remote --tags origin

    查看标签

    本地 tag 的删除:
    
    git tag -d <tagName>
    
    远程 tag 的删除:
    
    git push origin :refs/tags/<tagName>

    检出标签

    git checkout -b <branchName> <tagName>
     
  • 相关阅读:
    冲刺第一天(补发)
    进度条05
    npm start问题
    Spring Boot 默认配置无法访问静态资源
    Spring Boot 返回Html界面
    阿里云配置tomcat后不能访问问题
    Spring Boot Web开发中Thymeleaf模板引擎的使用
    tomcat官网改版后下载方式
    Ubuntu16.04进入无限登录状态的解决办法
    Ubuntu16.04安装MySql5.7
  • 原文地址:https://www.cnblogs.com/tianyun5115/p/15107420.html
Copyright © 2011-2022 走看看