Preview a Git push

后端 未结 4 1973
广开言路
广开言路 2020-12-28 12:30

How can I see which commits are actually going to be pushed to a remote repository?

As far as I know, whenever I pull master from the remote repository, com

4条回答
  •  渐次进展
    2020-12-28 13:02

    I've added the following aliases to my ~/.gitconfig, to show what would be merged (during a pull), what would be pushed, and an alias to diff against the remote:

    [alias]
            # diff remote branch (e.g., git diff origin/master master)
            difr = "diff @{u}"
    
            # similar to hg incoming/outgoing, showing what would be pulled/pushed
            # use option "-p" to see actual patch
            incoming = "!git remote update -p; git log ..@{u}"
    
            # showing what would be pushed (see also alias difr)
            outgoing = log @{u}..
    

提交回复
热议问题