Sparky
Sparky

Reputation: 2764

machine parsable method of comparing the current branch to the local view of the tracking branch

I need a machine parsable way of comparing the current branch to the local copy of the tracking branch.

These are the ideas I've tried, with their caveats:

Thanks for any ideas

Upvotes: 0

Views: 311

Answers (1)

Chronial
Chronial

Reputation: 70673

I think the command you are looking for is:

git rev-list HEAD..HEAD@{u}

This will list all commit SHAs that are on the tracking branch but not your local branch. rev-list is simply command for listing revisions and the @{u} on a branch name means “the remote tracking-branch of this branch”.

Upvotes: 2

Related Questions