0

I would like to get a list of files which are committed but not yet pushed. I tried git diff --name-only but this shows only the files which are changed but not yet committed. Once these file's are committed this commando does not work.

Any suggestions?

sanders
  • 10,794
  • 27
  • 85
  • 127

2 Answers2

0

You want the diff between the branch and the remote branch:

git diff origin/my-branch my-branch --name-only

(assumes your remote is called origin in this case.)

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
0

Based on answers to the question mentioned in comments, and git diff docs, the command should be:

$ git diff --name-only @{push}...HEAD

Note the 3 dots - it will make diff ignore upstream progress which happened since you created the branch or updated it last time.

max630
  • 8,762
  • 3
  • 30
  • 55