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

Re: why is git destructive by default? (i suggest it not be!)

From
DJDavid Jeske <jeske@google.com>
Date
Aug 14, 2016, 00:43 UTC
Message-ID
<willow-jeske-01l5oJ=64=91FEDjCgQT>
In-Reply-To
<willow-jeske-01l5oEsvFEDjCjRW>
As a more practical question, how do I do this workflow illustrated below?

It's sort of similar to the workflow that "git stash" is trying to support, except that I have a bunch of commits instead of a bunch of uncommitted-changes.

I pull a repository that looks like this:
.  a<--b<--c  <--master

Then I hack away to this, and then throw my own branch on the end, along with master:

. a<--b<--c<--d<--e<--f<--g <--master (jeske) . <--feature1 (jeske)

While the server looks like this:
.  a<--b<--c<--1<--2<--3  <--master (server)
I want to get my repository to look something like this:

. a<--b<--c<--1<--2<--3 <--master (jeske) . \ . d<--e<--f<--g <-- feature1 (jeske)

So I can then do this:

. a<--b<--c<--1<--2<--3<--zz <--master (jeske) . \ . d<--e<--f<--g <-- feature1 (jeske)

..and then push zz onto the server after 3.

..and I want to do it with safe commands that won't leave any dangling references. (say if I forget to put the feature1 branch on)

How do I do that?
Previous: David JeskeNext: Brandon Casey
Message 2 of 8 in “Re: why is git destructive by default? (i suggest it not be!)”
  1. David JeskeJun 24, 2008
  2. David JeskeAug 14, 2016
  3. Brandon CaseyJun 24, 2008
  4. David JeskeJun 24, 2008
  5. David JeskeAug 14, 2016
  6. Brandon CaseyJun 24, 2008
  7. Matthieu MoyJun 25, 2008
  8. Jing XueJun 25, 2008

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.