Is there a “git pull --dry-run” option in Git?

后端 未结 7 1369
星月不相逢
星月不相逢 2021-01-29 22:43

Is there such a thing as git pull --dry-run to see how stuff will be merged before it messes up my working tree?

Right now I am doing:

git f         


        
7条回答
  •  感情败类
    2021-01-29 23:33

    You will need to fetch first to update your local origin/master

    git fetch origin
    

    Then you can do:

    git diff --name-only origin/master
    

    Will list the files that have changed.

    git diff origin/master directory_foo/file_bar.m
    

    Will list the line by line diff of file directory_foo/file_bar.m.

提交回复
热议问题