Viewing unpushed Git commits

前端 未结 25 2398
Happy的楠姐
Happy的楠姐 2020-11-22 08:05

How can I view any local commits I\'ve made, that haven\'t yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X

25条回答
  •  花落未央
    2020-11-22 08:57

    It is not a bug. What you probably seeing is git status after a failed auto-merge where the changes from the remote are fetched but not yet merged.

    To see the commits between local repo and remote do this:

    git fetch
    

    This is 100% safe and will not mock up your working copy. If there were changes git status wil show X commits ahead of origin/master.

    You can now show log of commits that are in the remote but not in the local:

    git log HEAD..origin
    

提交回复
热议问题