zoukankan      html  css  js  c++  java
  • git命令

    一、 创建test分支提交步骤

    1.列出所有分支

    git branch -a

    2.创建test分支         

    git branch test

    3.切换到test分支:            

    git checkout test

    4.添加add修改:

    git add .

    5.添加commit注释

    git commit -m "第一次提交代码dx"

    6.提交到服务器

    git push origin test 

    二、将test分支合并到master本地分支

    1.创建test分支

    git branch test

    2.切换到test分支

    git checkout test

    3.在test分支添加一个readme.txt文件

     touch readme.txt
    
    git add readme.txt

    4.提交commit本地文件

    git commit -m “增加readme.txt”

    5.切换到master分支

    git checkout master

    6.把test分支合并到master分支

    git merge test

    7.提交master分支到服务器

    git push origin master

    8.删除test分支

    git branch -d test

    三、git 操作

    1. pick分支中某部分内容

    git fetch  拉去远程分支到本地
    git cherry-pick <commitid>   将某个commit pick到当前分支中

    2.git 查看文件冲突

      git checkout <branch>
    
      git fetch
    
      git rebase origin/release
    
      git diff

    3. 分支本地内容丢弃,从远程同步重置

    git reset --hard origin/release

     

     

    四、提交

    1.  提交所有tag到远程仓库

      git push --tags

    2. 提交所有分支到远程仓库

      git push --all 
    

      

    五、打tag并提交

    1、本地打tag

    git tag -a 0.1.3 -m “Release version 0.1.3″
    

    2、提交tag

    git push origin --tags
  • 相关阅读:
    id4的数据库持久化写法
    docker 加速镜像的地址收集
    mongodb 的ID转换实体要注意的地方
    net core3.0 常用封装状态码总结
    JAVA8—————StringJoiner类
    BigDecimal加减乘除
    mysql 查询奇偶数
    Java遍历Map对象的方式
    Java中List, Integer[], int[]的相互转换
    springboot 读取resources下的文件然后下载
  • 原文地址:https://www.cnblogs.com/jsondai/p/14513781.html
Copyright © 2011-2022 走看看