DEV Community

Luu Vinh Loc
Luu Vinh Loc

Posted on

Write a git diff command result to file to manage the big changes and ignore the lock files

Write the result of a git diff command to a file to manage large changes and ignore lock files.

git diff branch-name-0..branch-name-1 -- . ':(exclude)*.lock' > git.diff
Enter fullscreen mode Exit fullscreen mode

When ignoring multiple files:

git diff branch-name-0..branch-name-1 -- . ':(exclude)*.lock' ':(exclude)*.yaml' ':(exclude)*.yml' ':(exclude)*.json' > git.diff
Enter fullscreen mode Exit fullscreen mode

Top comments (0)