Re: Can not 'git add file'
- From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
- Date
- Jan 3, 2016, 16:20 UTC
- Message-ID
- <1451838002.3109.2.camel@kaarsemaker.net>
- In-Reply-To
- <1500251451832791@web17m.yandex.ru>
On zo, 2016-01-03 at 16:53 +0200, KES wrote:
Show 13 quoted lines
> 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