• git使用记录六:对commit的message做处理


    修改最新commit的message

    git commit --amend
    

    修改老旧commit的message

    查询最新的三个log

    soaeon@DESKTOP-FUJJTHR MINGW64 /f/gitstudy (master)
    $ git log -n 3
    commit 88400d127d5f33df816657cf5765d8e9563c9b88 (HEAD -> master)
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:28:29 2019 +0800
    
        update readme.md
    
    commit 2f3daee92d677983df1b30df5ccd9608d6053051
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:27:18 2019 +0800
    
        rename
    
    commit f51147967743aec46e111a7753cc9a6b7bde9384
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:26:36 2019 +0800
    
        add readme
    
    

    如果我们要修改32f575d33 这个log的message.,那么要基于它的parent(980e3beda)做查询

    git  rebase -i   f511479
    

    执行之后显示的数据如下:

    r 2f3daee rename  for readme.md
    pick 88400d1 update readme.md
    

    修改完成之后查询log

    $ git log -n 3
    commit 45c5445ae8fca52276f9ffca685c968f29066c8f (HEAD -> master)
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:28:29 2019 +0800
    
        update readme.md
    
    commit 98e4419eb04aa3ef95e6916948b37b14d67262cc
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:27:18 2019 +0800
    
        rename
    
            reword 7cc45c7 rename  for readme.md
    
    commit f51147967743aec46e111a7753cc9a6b7bde9384
    Author: soaoen <soaeon@163.com>
    Date:   Wed May 22 20:26:36 2019 +0800
    
        add readme
    
    

    发现log:rename 改成了 reword 7cc45c7 rename for readme.md

  • 相关阅读:
    初识Python(3)__Python 数字
    初识Python(2)__Python 对象
    正式开始学习python
    现代浏览器的工作原理
    data URI scheme
    连接池
    介绍缓存的基本概念和常用的缓存技术(转)
    前后端及常用语言介绍
    非关系型数据库和关系型数据库区别
    VC编译连接选项详解(转)
  • 原文地址:https://www.cnblogs.com/soaeon/p/10908465.html
Copyright © 2020-2023  润新知