-1

I would like to check all committed files from multiple commits on origin/master branch.

I have been checking following commands all are working on local branches only but not working on origin/master because they checking against origin/master only.

  • git diff master...<branch>,
  • git diff master... --name-only,
  • git diff HEAD origin/master --name-only,
  • git whatchanged/log --name-only --pretty="" origin..HEAD

How to can do the same operation on origin/master?

I am directly making changes on origin/master branch then commit the files. It can be multiple commits. Now, I would like to know what are all the files that I changed on master branch.

Techie
  • 759
  • 4
  • 11
  • 29
  • 3
    I'm not clear what you're looking for here, and what you mean by "checking against origin/master only" - what do you want it to check against instead? Perhaps you could [edit] your question to include an example of the steps you go through (creating a branch, changing some files, etc), and the output you want to see? Make sure you include details of how the output you want is different from the output you get with the commands you've tried. – IMSoP Aug 14 '18 at 10:36
  • I am directly changing master branch only. So, before I push my changes I would like to find the list. – Techie Aug 14 '18 at 11:09
  • What do you mean by _the list_? – Clijsters Aug 14 '18 at 11:10
  • @Clijsters committed files. – Techie Aug 14 '18 at 11:11
  • 1
    What's the problem with `git diff HEAD..origin/master`? – Clijsters Aug 14 '18 at 11:14
  • I do not know why somebody gave down vote. – Techie Aug 14 '18 at 11:14
  • 3
    @Rekha: I think, because the most users don't understand your question. – Clijsters Aug 14 '18 at 11:15

1 Answers1

0

I would like to check all committed files from multiple commits before I push on origin/master branch.

GITK approach

One easy approach for you is using gitk, if you don't have gitk install the gitk in your system, go to your master.

git checkout master and then start gitk from the origin you will see the list of committed files in the master.


Method 2: Without gitk.

If you don't want to use gitk then another approach to list the commited files in branch. For master first you switch to the origin master issuing,

git checkout master
git show --pretty="" --name-only <sha>
danglingpointer
  • 4,708
  • 3
  • 24
  • 42
  • Thanks for your reply. `git show --pretty="" --name-only` will show only lastest commit. What if I have multiple commits. I am changing master branch directly and would like find the files which are committed. – Techie Aug 14 '18 at 11:26
  • for all commit better I suggest you to use gitk that is user friendly for the beginners. – danglingpointer Aug 14 '18 at 11:27
  • What do you mean by "changing master branch directly"? Also, would [this question/answer](https://stackoverflow.com/questions/8533202/list-files-in-local-git-repo) help? – evolutionxbox Aug 14 '18 at 13:01