• git 分支管理


    1. 创建分支;

        git branch name   

    2. 查看分支;

        git branch 

    3. 切换分支;

        git checkout name

    4.创建并切换分支;

        git checkout -b name

    5.合并分支;

        git merge name

    6.删除分支;

        git branch -d name

        git branch -D name 强行删除; 删除没有合并的分支


    7. 合并冲突解决;

      手动修改后 add  commit

      使用 $git log --graph --pretty=oneline --abbrev-commit 查看合并情况图

      --graph 图表;

      --abbr-commit   log的缩写;


    8. 禁用fast-forward   --no-ff

      由于使用fast-forward 模式,在合并分支并删除分支 后会丢掉删除分支的修改信息;  

      git merge --no-ff -m '合并信息' <branch_name> 


    9. $git stash      储存工作现场;

      $git stash list    查看stash;

      恢复现场有两个方法;

        方法1. $git stash apply 恢复后stash内容并没有删除,使用 $git stash drop  删除;

        方法2. $git stash pop 恢复后并删除stash


       可以多次stash;  用$git stash list;查看; 再用$git stash apply stash@{0} 恢复指定的stash;

      

       

        

        

    [Power By XIAOWU]
  • 相关阅读:
    Django-4
    Django-3
    博客中涉及的源码下载
    源码阅读系列:EventBus
    使用DFA做文本编辑器的自动提示
    计算机网络-IP类型判断
    感兴趣的文章搜集
    The Engine Document of JustWeEngine
    [译文]选择使用正确的 Markdown Parser
    Android源码阅读-Filter过滤器
  • 原文地址:https://www.cnblogs.com/webmans/p/8093103.html
Copyright © 2020-2023  润新知