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

Re: Bug Report - Segmentation Fault on "git add --all"

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Jul 20, 2017, 05:01 UTC
Message-ID
<CAN0heSrzdfpH=ocQrC3SYLNF2K=agdKuRdscSPnnCgBMWhPRxg@mail.gmail.com>
In-Reply-To
<CAO1QjAFGnK+riGT_ZffM_-=ymJm08U8adOfHV4wrhR9LJLhSAA@mail.gmail.com>
On 20 July 2017 at 02:54, Tillson Galloway <tillson.galloway@gmail.com> wrote:
Show 7 quoted lines
> Context:
> We currently have a git project with a root directory ("~/project")
> for pipelines and deployment of a Node app, and then a subdirectory
> ("~/project/project-app").
> After realizing that we didn't need the node app in a subdirectory, we
> moved the full app into the root directory (using the mv command).
>
[...]
>
> Running "git status" shows that git successfully tracked that the
> original files within ~/project/project-app were deleted, but it did
> not pick up the "newly created" files from moving.
So you did "mv project-app/* ." and see something like
  Changes not staged for commit:
    (use "git add/rm <file>..." to update what will be committed)
    (use "git checkout -- <file>..." to discard changes in working directory)
      deleted:    ... lots of files ...

? That means Git has *realized* that the files are gone, but it's not *tracking* that fact (yet).

What if you restore the files and instead try "git mv project-app/* ."? It will move the files like "mv", but it will also do basically what you wanted to achieve with "git add --all". After that, you'll just have to "git commit".

You'll probably want to "rmdir project-app/" once it's empty. If you have some structure like project-app/project-app/ the move might fail (should be possible to work around).

This obviously doesn't address the problem you saw and on which I cannot comment, but I hope it helps you do what you actually wanted to do. :)

Martin
Previous: Tillson Galloway
Message 2 of 2 in “Bug Report - Segmentation Fault on "git add --all"”
  1. Tillson GallowayJul 20, 2017
  2. Martin ÅgrenJul 20, 2017

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.