2

I am working on git repo which has no git flow setup means it does not have master, develop, feature branch. I cloned this repo and I have created a branch test_branch and I made changes on my local branch and did multiple commits then pushed them. Now, I would like to find out list of files I have pushed.

All the git diff commands I found are comparing with origin/master, HEAD and so but in my case this will not be available . I will push my changes by setting up an upstream like git push -u origin test_branch. In such scenario how can I find list of files which I have pushed?

I have tried following commands but not matching with my requirement

  • git log --name-only pattern=""
  • git diff origin/master...

git log shows complete information on local branch but I need only files which I have pushed. After one git push I might do one more set of commits and doing git push I need only files which I pushed recently.

I am getting this error when I try with origin/master.

fatal: ambiguous argument 'origin/master...': unknown revision or path not in the working tree.

I am looking for a command which is purely depend on local branch to find out the pushed files.

EDIT: How to list all the files in a commit? will not solve my problem becuase,

  1. I do not have commit ids
  2. I need list of files from multiple commits not from last or recent commit.
Techie
  • 759
  • 4
  • 11
  • 29
  • I'm not a git expert, but what if you do not use origin/master but actually your branch name. like for example `git diff --name-only test_branch` ? – the hand of NOD Aug 28 '18 at 06:37
  • @ the hand of NOD You are comparing with same branch , how it will find the diff, gives no output. – Techie Aug 28 '18 at 07:01

0 Answers0