no13bus
V2EX  ›  问与答

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

  •  
  •   no13bus · Oct 22, 2014 · 12100 views
    This topic created in 4250 days ago, the information mentioned may be changed or developed.
    6 replies    2014-10-23 22:39:55 +08:00
    chemzqm
        1
    chemzqm  
       Oct 22, 2014   ❤️ 1
    git diff [options] <commit> <commit> [--] [<path>...]
    no13bus
        2
    no13bus  
    OP
       Oct 22, 2014
    git diff HEAD^ HEAD
    zsh: no matches found: HEAD^

    $ git diff HEAD\^ HEAD
    成功.
    用的zsh 发现head后面的^需要转意
    yangg
        3
    yangg  
       Oct 22, 2014
    git show # view the diff of last commit
    git whatchanged
    git log --stat --date=relative
    spritevan
        4
    spritevan  
       Oct 22, 2014
    git log -p path_to_file
    vibbow
        5
    vibbow  
       Oct 23, 2014
    sourcetree
    julyclyde
        6
    julyclyde  
       Oct 23, 2014
    如果pull的时候merge进来很多commit
    就不能用HEAD和HEAD~1比较了吧?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1015 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 22:39 · PVG 06:39 · LAX 15:39 · JFK 18:39
    ♥ Do have faith in what you're doing.