Git fatal: ambiguous argument '|': unknown revision or path not in the working tree

3.2k Views Asked by At

When I open git bash and execute the follow command, I have no problem!

  git log --no-renames --after=’2020-01-01’ --diff-filter=D --summary | grep 'delete mode' > log.txt

But When I try to execute this:

GitTasks.Git(@"log --no-renames --after=’2020-01-01’ --diff-filter=D --summary | grep 'delete mode' > files.20.exclude", @"D:\folder\myproject");

I Get those errors:

fatal: ambiguous argument '|': unknown revision or path not in the working tree.

fatal: ambiguous argument '>': unknown revision or path not in the working tree.

What I have to do to get the same result?

1

There are 1 best solutions below

0
On BEST ANSWER

I got the problem, I was executing bash commands expecting to work with git like @axiac commented!

For resolving my problem, I wrote the log to a file without | grep 'delete mode' and > log.txt and removed everything that I didn't want.