zoukankan      html  css  js  c++  java
  • git

    强烈推荐一本很不错的git书籍:https://git-scm.com/book/zh-tw/v2

    常用git命令

    1.查看某个文件的修改记录

    git log --pretty=oneline forward.c

    2.查看某个commit id的具体信息

    git show 671ff15f2d8cb78133c4fea6b0f5270adb992c66

    3.撤销

    git reset --soft HEAD~2

    下面的连接有对参数--soft --hard --mixed的解释,一般情况下就用soft就行
    https://blog.csdn.net/hbwindy/article/details/51519999

    4.git stash

    从git stash中恢复 指定的文件
    git checkout --patch stash@{0} path/to/file

    来自 <https://stackoverflow.com/questions/1105253/how-would-i-extract-a-single-file-or-changes-to-a-file-from-a-git-stash>


    git stash :什么参数不加,会分别对暂存区(没有add的)和工作区(add之后的)的状态进行保存。
    git stash save "message":save可以添加保存时的备注。示例:git stash save "完成user接口"
    git stash list:显示备份列表。
    git stash pop:不使用任何参数,会恢复最近一次的备份文件(也就是stash list中的stash@{0}),并将恢复的工作进度从存储的工作进度列表中清除。
    git stash clear: 删除所有存储的进度

    来自 <https://blog.csdn.net/KingBoyWorld/article/details/76408819>

    5.git clean -fd ./

    Remove untracked file(f) and directory(d)

    6.git blame file_name

    这样,我们就可以知道commit ID了,然后使用命令:git show commitID来看

  • 相关阅读:
    TF中的自定义正则项
    [工具]多线程下载 axel
    [算法]kv-memory 表示dense特征
    [code]tensorflow分桶
    [code]Keras API的用法记录
    vim显示下划线不高亮问题
    [代码] kv2sparse
    [代码]并发执行python的例子
    AI算法手册
    [工具]soundflower
  • 原文地址:https://www.cnblogs.com/midhillzhou/p/12911559.html
Copyright © 2011-2022 走看看