Using Git how do I find changes between local and remote

前端 未结 11 1295
感情败类
感情败类 2020-11-29 15:16

Here are two different questions but I think they are related.

  1. When using Git, how do I find which changes I have committed locally, but haven\'t yet pushed

11条回答
  •  星月不相逢
    2020-11-29 15:43

    When the "git log" and @{u} answers initially gave me "unknown revision" errors, I tried out Chris/romkyns suggestion of git push --dry-run.

    You will get an output such as "5905..4878 master->master". 5905 is the latest commit that the remote has and commits through (and including) 4878 will be applied to the remote.

    You can then use 5905..4878 as arguments to several other git commands to get more details:

    git diff 5905..4878 # Gives full code changes in diff style
    
    git log --online 5905..4878 # Displays each commit's comment
    

提交回复
热议问题