zoukankan      html  css  js  c++  java
  • git 分支 branch 操作

    创建分支

    git branch test: 基于当前commit创建test分支。.git/HEAD 文件中记录了当前分支名字。

    删除分支

    git branch -d test:删除本地test分支
    
    git branch -D test: test分支还没有合入当前分支,所以要用-D参数才能删掉。
    
    git push origin --delete test 删除远程test分支
    
    git push origin :test 删除远程test分支

    查看分支

    git branch 列出当前分支清单
    
    git branch -a 查看远程分支和本地分支
    
    git branch -v 查看各个分支最后一个提交信息
    
    git branch --merged 查看哪些分支已经合并入当前分支

    拉取分支 

    git fetch origin 同步远程服务器的数据到本地
    
    git checkout -b test origin/test_remote 将远程分支test_remote拉取下来到本地test分支
    
    git checkout test 将远程分支test拉取下来到本地test分支
    
    git pull test从远程分支test 中checkout下来的本地分支test成为跟踪分支,使用git pull或者git push就会操作到对应的远程分支test
  • 相关阅读:
    边框的各种样式
    内容溢出显示省略号
    UNIAPP开发注意事项
    css文本的三条线 删除线 下划线 上划线
    防抖截流
    浏览器窗口改变触发的函数
    ES5数组方法
    弹性布局
    ubuntu16.04 安装adb
    git clone
  • 原文地址:https://www.cnblogs.com/horanly/p/10551324.html
Copyright © 2011-2022 走看看