0

git diff is giving different results from git diff --summary, and git pull is giving me different results from the diffs. Each of the commands below tell me something different is modified.

git.diff

$ git diff  | grep -i '\-\-\- a/'
--- a/apps/Makefile
--- a/apps/s_client.c
--- a/apps/s_server.c
--- a/config
--- a/crypto/Makefile
--- a/crypto/aes/Makefile
--- a/crypto/asn1/Makefile
--- a/crypto/bf/Makefile
--- a/crypto/bio/Makefile
<61 total>
...

git diff --summary

openssl-git$ git diff --summary
delete mode 100644 test/fips_algvs.c
delete mode 100644 test/igetest.c

git pull

openssl-git$ git pull
Updating ba16824..24e20db
error: Your local changes to the following files would be overwritten by merge:
        apps/s_server.c
Please, commit your changes or stash them before you can merge.
Aborting

I followed https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-mode-changes-chmod to clear most of the differences, but there's still some problems in updating the repo.

What precisely do I need to do to update this repository?

jww
  • 97,681
  • 90
  • 411
  • 885

2 Answers2

1

To have git pull work, it looks like the app/s_server.c file is changed or untracked locally, but not committed, and there is a commit for that same file. You could move that file temporarily or commit it to have the pull succeed, then reconcile the differences

Dan McClain
  • 11,780
  • 9
  • 47
  • 67
0

To see the list of modified tracked files, instead of

git diff  | grep -i '\-\-\- a/'

you can use git diff --stat.

git diff --summary only shows renaming, creation, and change of permissions of files.

When you pull the changes from a distant repository, your working copy must be clean. In the example you showed, git says that your local file apps/s_server.c is modified, and the pull wants to modify it too. I could tell you a log about different ways to temporarily save the local changes while you call git-pull (particularly using git-stash), but you seem to be a beginner with git, and I do not want to confuse you more about a log of new git commands. Either you commit your changes, and git-pull will do a merge of the local and distant changes, or make sure that apps/s_server.c is not locally modified before you call git pull.

lrineau
  • 6,036
  • 3
  • 34
  • 47