zoukankan      html  css  js  c++  java
  • Git常用命令

    # Git常用操作
    ## 全局配置
    git config --global user.name "name"
    git config --global user.email "email"

    ## 撤销
    当前版本:HEAD
    上一个版本:HEAD^
    上上一个版本:HEAD^^
    上100个版本:HEAD~100
    工作区撤销:git checkout -- filename
    暂存区撤销:git reset HEAD filename
    本地库撤销:git reset --hard HEAD^ / git reset --hard commit_id

    ## 合并commit
    git rebase -i [startpoint] [endpoint]
    其中-i的意思是--interactive,即弹出交互式的界面让用户编辑完成合并操作,[startpoint] [endpoint]则指定了一个编辑区间,如果不指定[endpoint],则该区间的终点默认是当前分支HEAD所指向的commit(注:该区间指定的是一个前开后闭的区间)
     
    pick:保留该commit(缩写:p)
    reword:保留该commit,但我需要修改该commit的注释(缩写:r)
    edit:保留该commit, 但我要停下来修改该提交(不仅仅修改注释)(缩写:e)
    squash:将该commit和前一个commit合并(缩写:s)
    fixup:将该commit和前一个commit合并,但我不要保留该提交的注释信息(缩写:f)
    exec:执行shell命令(缩写:x)
    drop:我要丢弃该commit(缩写:d)
  • 相关阅读:
    2019年11月体重管理进展
    云锵投资 2019 年 11 月简报
    2019年10月体重管理进展
    云锵投资 2019 年 10 月简报
    2019年9月体重管理进展
    云锵投资 2019 年 09 月简报
    2019年8月体重管理进展
    云锵投资 2019 年 08 月简报
    分布式系统发展史
    2019年7月体重管理进展
  • 原文地址:https://www.cnblogs.com/bigcat47/p/9795249.html
Copyright © 2011-2022 走看看