V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
no13bus
V2EX  ›  问与答

git pull 之后 有文件改变了 如何查看文件的具体改变情况?

  •  
  •   no13bus · 2014-10-22 16:04:19 +08:00 · 11475 次点击
    这是一个创建于 3467 天前的主题,其中的信息可能已经有所发展或是发生改变。
    6 条回复    2014-10-23 22:39:55 +08:00
    chemzqm
        1
    chemzqm  
       2014-10-22 16:16:21 +08:00   ❤️ 1
    git diff [options] <commit> <commit> [--] [<path>...]
    no13bus
        2
    no13bus  
    OP
       2014-10-22 18:58:35 +08:00
    git diff HEAD^ HEAD
    zsh: no matches found: HEAD^

    $ git diff HEAD\^ HEAD
    成功.
    用的zsh 发现head后面的^需要转意
    yangg
        3
    yangg  
       2014-10-22 19:34:02 +08:00
    git show # view the diff of last commit
    git whatchanged
    git log --stat --date=relative
    spritevan
        4
    spritevan  
       2014-10-22 20:10:02 +08:00
    git log -p path_to_file
    vibbow
        5
    vibbow  
       2014-10-23 01:35:16 +08:00
    sourcetree
    julyclyde
        6
    julyclyde  
       2014-10-23 22:39:55 +08:00
    如果pull的时候merge进来很多commit
    就不能用HEAD和HEAD~1比较了吧?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5200 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 08:24 · PVG 16:24 · LAX 01:24 · JFK 04:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.