0

A newbie to Git. I am in the process of migrating a project from ClearCase to Git. The code has been committed to my local Master repository by me. I am ready to push the code to THE Repository However, I wanted to count as to how many files will be pushed before I do the push. As a measure of cross verification. I have tried following options:

git diff --numstat | wc -l
git diff --numstat
git diff --cached --stat
git rev-list HEAD --count
git diff <lastCommit>
git whatchanged -1

But none of them gives me the count of files. Is there a git command existing to count the numbers of files being pushed to Main Repository before actual Push ?

DolphinJava
  • 2,682
  • 1
  • 23
  • 37
  • 1
    you can look here: http://stackoverflow.com/questions/7624790/what-is-the-git-equivalent-of-of-hg-outgoing-hg-out-or-hg-incoming-hg-in – lpg Jul 17 '14 at 20:54
  • It did not help. It just listed the commit name, author, date and the message. But not the count of the files to be pushed. – DolphinJava Jul 17 '14 at 21:02
  • What's wrong with `git diff --numstat | wc -l` ? – janos Jul 17 '14 at 21:42
  • @Janos: It returned me a formatted output. It shows number zero preceded by few white spaces in bash and then a blank line – DolphinJava Jul 18 '14 at 13:40

1 Answers1

0

I noticed that while performing a merge of a branch with local master branch using following command, the number of files changed is listed.

git merge <branchName>

I get following messages of which two indicate number of files. The lines in bold indicate the number of files that are eligible. Following are the messages I obtained.

Updating 5b3f46f..9658272 Checking out files: 100% (49/49), done. fast-forward list of the files that were merged. 49 files changed, 4900 insertions(+) create mode messages..

But this does not gives an absolute number of files that will be pushed to public master branch. In case there are merges from multiple branchesI am using Git-1.9.4-preview20140611 version, we cannot rely on these numbers.

Also, I am using Git-1.9.4-preview20140611. Messages may differ from version to version

DolphinJava
  • 2,682
  • 1
  • 23
  • 37