I performed a fresh clone and copied/pasted a working directory into the cloned directory. Now have a list of changed files:
$ git status --short | grep -v "??" | cut -d " " -f 3
GNUmakefile
Readme.txt
base32.h
base64.h
...
When I try to get Git to add them, it results in an error (I don't care about adding 1 at a time):
$ git status --short | grep -v "??" | cut -d " " -f 3 | git add
Nothing specified, nothing added.
Maybe you wanted to say 'git add .'?
Adding the -
:
$ git status --short | grep -v "??" | cut -d " " -f 3 | git add -
fatal: pathspec '-' did not match any files
And --
:
$ git status --short | grep -v "??" | cut -d " " -f 3 | git add --
Nothing specified, nothing added.
Maybe you wanted to say 'git add .'?
Trying to use interactive from the man page appears to have made a greater mess of things:
$ git status --short | grep -v "??" | cut -d " " -f 3 | git add -i
staged unstaged path
1: unchanged +1/-1 GNUmakefile
2: unchanged +11/-11 Readme.txt
...
*** Commands ***
1: status 2: update 3: revert 4: add untracked
5: patch 6: diff 7: quit 8: help
Huh (GNUmakefile)?
What now> *** Commands ***
1: status 2: update 3: revert 4: add untracked
5: patch 6: diff 7: quit 8: help
Huh (Readme.txt)?
(I've already deleted the directory Git made a mess of, so I'm not trying to solve that issue).
How do I tell Git to add the files piped into it?
git-add
's-p
flag? – Brian Hannay May 06 '18 at 17:53