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

Re: How do you undo an add

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Nov 19, 2024, 08:13 UTC
Message-ID
<271da43e-22d8-4f67-952e-72d2af8f6b1b@app.fastmail.com>
In-Reply-To
<022f01db3a10$7fe28140$7fa783c0$@nexbridge.com>
On Tue, Nov 19, 2024, at 00:20, rsbecker@nexbridge.com wrote:
Show 18 quoted lines
> On November 18, 2024 5:10 PM, A bughunter wrote:
>>BROAD OVERVIEW
>>
>>bugreport[A], question[B] and use-case[C]. These are all related but separate
>>threads for the purposes as labled. Please do not cross-post or cross-quote. Focus
>>on productivity and solving these. You are welcomed to view and participate in all of
>>these as I contribute more.
>>
>>use-case[C] - git question (short) rephrase with use-case added.
>>
>>ADD, ADD, ADD why cant they get that: ADD. ADD tracks files for commit. It's
>>already been commit : push failed. Failed pushes piled up. I need them untracked.
>>How do you undo an add ( many adds): simple question. Without deleting any files,
>>to repush 1 by 1.
>
> Once you have pushed an added file, your only option is filter-branch
> to prune out the
> invalid content.

git-filter-branch? Why not `git reset --hard` with `push --force-with-lease --force-if-includes`? Maybe I’m missing something.

> Following a commit, you can use reset --HARD to move the branch head back to a
> Commit where the add did not happen.
Yeah exactly.
-- 
Kristoffer Haugsbakk
Previous: rsbecker@nexbridge.comNext: A bughunter
Message 4 of 11 in “How do you undo an add”
  1. A bughunterNov 17, 2024
  2. A bughunterNov 18, 2024
  3. rsbecker@nexbridge.comNov 18, 2024
  4. Kristoffer HaugsbakkNov 19, 2024
  5. A bughunterNov 19, 2024
  6. A bughunterNov 19, 2024
  7. rsbecker@nexbridge.comNov 19, 2024
  8. Konstantin RyabitsevNov 20, 2024
  9. A bughunterNov 20, 2024
  10. A bughunterDec 5, 2024
  11. A bughunterNov 19, 2024

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.