How to preview git-pull without doing fetch?

前端 未结 8 2025
天涯浪人
天涯浪人 2020-11-29 14:41

Is it even possible?

Basically, there\'s a remote repository from which I pull using just:

git pull

Now, I\'d like to preview what

8条回答
  •  孤独总比滥情好
    2020-11-29 15:21

    I may be late to the party, but this is something which bugged me for too long. In my experience, I would rather want to see which changes are pending than update my working copy and deal with those changes.

    This goes in the ~/.gitconfig file:

    [alias]
            diffpull=!git fetch && git diff HEAD..@{u}
    

    It fetches the current branch, then does a diff between the working copy and this fetched branch. So you should only see the changes that would come with git pull.

提交回复
热议问题