From: Junio C Hamano Date: Fri, 15 Jul 2011 19:39:30 GMT Subject: Re: "git apply" can't add new files to repo ? Message-ID: <7vd3hb1ggd.fsf@alter.siamese.dyndns.org> In-Reply-To: Yang writes: > I created a patch by "git format-patch", and this patch includes some > newly-added files. > > when I got back to the original branch, and apply this patch, the new > files appear, but they are not > added to git repository, so I have to manually find all the new files > and do "git add" for each of them. You are doing and thinking wrong. $ git apply patch $ git commit would not add any new contents to existing paths either. $ git apply --index patch $ git commit would be the way, but that is why we have "git am".