git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to commit removed file?

From
MTMichael S. Tsirkin <mst@mellanox.co.il>
Date
Jan 3, 2007, 06:06 UTC
Message-ID
<20070103060640.GD20259@mellanox.co.il>
In-Reply-To
<7vfyatt8di.fsf@assigned-by-dhcp.cox.net>
Mutt Label Removed By VIM
Show 33 quoted lines
> Quoting r. Junio C Hamano <junkio@cox.net>:
> Subject: Re: How to commit removed file?
> 
> >> > I'd like to remove a file and commit the removal while
> >> > leaving out other changes in repository/index.
> >> > 
> >> > $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch
> >> > rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'
> >> > 
> >> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch
> >> > error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match
> >> > any file(s) known to git.
> >> > Did you forget to 'git add'?
> >> > 
> >> > A similiar thing works with "git add".
> >> 
> >> Any ideas? Can this be done with git?
> >
> > Did you actually try the "--" thing I suggested in 
> > http://article.gmane.org/gmane.comp.version-control.git/35699/?
> >
> > Besides, I just tested with current "next": 
> >
> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch
> > Created commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2
> >  1 files changed, 0 insertions(+), 22 deletions(-)
> >  delete mode 100644 a234
> 
> The difference is Michael did "git rm" to explicitly tell git to
> forget about that path, while you used the vanilla "/bin/rm".
> 
> Personally I never saw the point of having "git rm".  Maybe we
> should remove it to prevent this confusion from happening.
But won't the same problem appear with

rm file git-update-index file git-commit file

-- 
MST
Previous: Jakub NarebskiNext: Junio C Hamano
Message 12 of 16 in “How to commit removed file?”
  1. Michael S. TsirkinDec 31, 2006
  2. Johannes SchindelinDec 31, 2006
  3. Michael S. TsirkinJan 2, 2007
  4. Johannes SchindelinJan 2, 2007
  5. Junio C HamanoJan 2, 2007
  6. Jakub NarebskiJan 2, 2007
  7. Johannes SchindelinJan 2, 2007
  8. Carl WorthJan 3, 2007
  9. Junio C HamanoJan 6, 2007
  10. Carl WorthJan 12, 2007
  11. Jakub NarebskiJan 12, 2007
  12. Michael S. TsirkinJan 3, 2007
  13. Junio C HamanoJan 3, 2007
  14. Junio C HamanoJan 3, 2007
  15. Michael S. TsirkinJan 4, 2007
  16. Juergen RuehleJan 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.