zoukankan      html  css  js  c++  java
  • Git命令本质

    引言

    这是以前学习Git时的个人理解,算是速查手册吧

    Command Essential
    base^n 选择base分支的第n个父分支
    base~n 选择base的第n级父结点
    git commit --amend 产生一个已提交结点的兄弟结点
    git tag label to 为to结点赋与标签label
    git branch -f from to 将分支from指向to
    git merge from 将分支from合并到当前活动分支
    git rebase to from 拷贝分支from(缺省为当前活动分支),接续到分支to的后面
    git reabse -i base_offset 对base第offset个父结点以下的结点进行交互排序
    git cherry-pick c1 c2 ... 撷取结点c1、c2等接到当前活动分支之后
    git reset base_offset 将分支base的指向回溯到其第offset级父结点
    git revert base_offset 拷贝一份base第offset级父结点,接续到当前结点之后
    repo/branch 远程仓库repo的branch分支
    git branch -u remote local 将远程分支remote绑定到本地已有分支local
    git checkout -b local remote 新建本地分支local,绑定至远程分支remote
    git pull --rebase 采取rebase而不是默认的merge模式,拉取远程分支
    git fetch repo remote:local 下载远程remote分支的副本到本地的local分支(非活动分支),省略remote时将在本地创建local分支
    git pull repo remote:local 先fetch再merge入当前活动分支
    git push repo local:remote 将本地分支local推送至远程仓库repo的remote分支,省略local时将会删除远程分支
  • 相关阅读:
    PHP定时备份MySQL,mysqldump语法大全
    虚拟机拷贝之后,发现系统内的开机自启动的nginx,不能自启动了
    八:二叉搜索树的后序遍历
    配置Ubuntu开发环境
    poj 1147 Binary codes
    test
    Python标准库:内置函数reversed(seq)
    Matplotlib 工具包 使用教程索引
    6大设计原则(1):单一职责原则
    hdu 4104
  • 原文地址:https://www.cnblogs.com/Abbey/p/12770001.html
Copyright © 2011-2022 走看看