Skip to content

--filter=[origin/main] vs --filter=[origin/main...HEAD] #8956

Closed Answered by NicholasLYang
harshits2808 asked this question in Help
Discussion options

You must be logged in to vote

Hey, yeah this is subtle and slightly confusing. If a git range has a defined end, e.g. [a...b], we do not include staged or uncommitted changes. If it has only a start, e.g. [a], we include staged or uncommitted changes.

However, I don't think that's your issue. The other main difference is that [a...b] underneath the hood calls git diff a...b, while [a] calls git diff a. Note the three dots in a...b. This gets the diff between the merge-base of a and b and b (git docs). This is effectively getting the diff that is your branch. With git diff a, that's getting the difference between a and your current commit (git docs). So in the case where that's main, that will include both the code add…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@harshits2808
Comment options

Answer selected by NicholasLYang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants