1

I have the following folder structure:

| folder1 
│   ├── file1
│   ├── file2
│   ├── subFolder1
│   │  ├── subFile1
│   │  ├── subFile2


| folder2
│   ├── file1
│   ├── file2
│   ├── subFolder1
│   │  ├── subFile1
│   │  ├── subFile2

I would like to check the differences between folder1 and folder2 in my desktop but excluding the subFolder1 (which have different files, but I have no interest in their differences)

Is it possible to do this with git diff or diff/ any other utility from linux?

Straight up comparison is possible with:

git diff folder1/ folder2/

However, I do not know how to exclude a folder from comparison.

I tried the commands in Exclude a directory from git diff but to no success so far. I have an an error saying:

Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
Manuel Oliveira
  • 527
  • 5
  • 19

0 Answers0