{"thread":{"id":"41111","subject":"Can not 'git add file'","startedAt":"2016-01-03T14:53:11Z","lastAt":"2016-01-03T16:20:02Z","messageCount":2,"participants":["KES","Dennis Kaarsemaker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"275275","messageId":"1500251451832791@web17m.yandex.ru","threadId":"41111","inReplyTo":null,"subject":"Can not 'git add file'","fromName":"KES","fromEmail":"kes-kes@yandex.ua","sentAt":"2016-01-03T14:53:11Z","receivedAt":"2016-01-03T14:53:11Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ua","avatar":null},"body":"Hi.\n\nHow to reproduce\n\n$ git-number\nOn branch master\nChanges not staged for commit:\n  (use \"git add <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n1\tmodified:   ../lib/Devel/DebugHooks.pm\n2\tmodified:   ../lib/Devel/KillPrint.pm\n3\tmodified:   00-simple.t\n\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n4\t../lib/Devel/DebugHooks/\n5\t../lib/Devel/ImportArgs.pm\n6\t../lib/Devel/KillPrintTest.pm\n7\t../lib/Devel/KillPrint_scope.pm\n8\t../lib/Devel/PkgAtCompileTime.pm\n9\t../lib/Devel/t.pl\n10\tlib/Devel/AutoInit.pm\n11\tlib/Devel/DZVii.pm\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n$ git add -p ../lib/Devel/DebugHooks/Commands.pm \nNo changes.\n\nI want to start track file here, but I do not want to stage while file.\n\nIt seems the git can not process this case and do not allow me to complete that.\n"},{"id":"275277","messageId":"1451838002.3109.2.camel@kaarsemaker.net","threadId":"41111","inReplyTo":"1500251451832791@web17m.yandex.ru","subject":"Re: Can not 'git add file'","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2016-01-03T16:20:02Z","receivedAt":"2016-01-03T16:20:02Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On zo, 2016-01-03 at 16:53 +0200, KES wrote:\n> Untracked files:\n>   (use \"git add <file>...\" to include in what will be committed)\n> \n> 4       ../lib/Devel/DebugHooks/\n> \n> $ git add -p ../lib/Devel/DebugHooks/Commands.pm\n> No changes.\n> \n> I want to start track file here, but I do not want to stage while\n> file.\n> \n> It seems the git can not process this case and do not allow me to\n> complete that.\n\nCorrect, add -p for a new file is not supported, as it doesn't really\nmake sense. There's no patch, it's a whole new file.\n\nWhat you can do instead is first \n\ngit add -N ../lib/Devel/DebugHooks/Commands.pm\n\nto mark the file as tracked without adding content. Then git add -p\nwill allow you to add the contents partially.-- \nDennis Kaarsemaker\nwww.kaarsemaker.net\n"}]}