Subject: Re: Can not 'git add file'

From: Dennis Kaarsemaker <[email-masked]>
Date: Sun, 03 Jan 2016 17:20:02 +0100

On zo, 2016-01-03 at 16:53 +0200, KES wrote:
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 
> 4       ../lib/Devel/DebugHooks/
> 
> $ git add -p ../lib/Devel/DebugHooks/Commands.pm
> No changes.
> 
> I want to start track file here, but I do not want to stage while
> file.
> 
> It seems the git can not process this case and do not allow me to
> complete that.

Correct, add -p for a new file is not supported, as it doesn't really
make sense. There's no patch, it's a whole new file.

What you can do instead is first 

git add -N ../lib/Devel/DebugHooks/Commands.pm

to mark the file as tracked without adding content. Then git add -p
will allow you to add the contents partially.-- 
Dennis Kaarsemaker
www.kaarsemaker.net