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,392
  • 26
  • 84
  • 126

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
  • 260,367
  • 30
  • 546
  • 667
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
  • 7,979
  • 3
  • 27
  • 52