[haiku-development] Re: GIT help

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 1 Apr 2013 21:15:14 -0400

On Mon, Apr 1, 2013 at 8:18 PM, Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>wrote:
>
> I'll have to do a commit at some point, I guess, but the description of
> 'git format-patch' didn't sound to be what I wanted (a diff to attach to
> a ticket) so I haven't yet tried it.  Another point I didn't understand is
> that I have to *add* all the files in that directory that I want to commit,
> even if they are originally in the tree.  Correct? (I guess so, I just did
> that.)
>

git format-patch is what you want, it will create a diff with some
information added such as the author's name and email address so that when
the patch is applied with git apply the author of the patch will be
preserved. This works a bit differently than svn where you create a patch
using svn diff.

When you run git add on a file you add it to the staging area to be
committed, either because it is new to the repo or because it has been
modified.


> And what about those deleted files?  I just added all the files in the
> patchbay
> directory and they are now marked for commit.  But the three deleted ones
> are still marked as "not staged for commit".  I tried 'git add <deleted
> file>'
> and got no complaint, but they're *still* 'not staged'.  Are they going to
> stay in the tree after commit?
>

To stage a file to be deleted from the repository run git rm <file>. If you
have already deleted the file from disk using rm, or if you want to delete
the file from the repo but leave it on disk run git rm --cache <file>
instead. Since you said you deleted those files already you should use the
--cache version in this case.

John Scipione

Other related posts: