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

Re: How to create independent branches

From
PBPeter Baumann <peter.baumann@gmail.com>
Date
Apr 9, 2006, 08:22 UTC
Message-ID
<20060409082248.GB4798@xp.machine.de>
In-Reply-To
<20060409081105.GA4798@xp.machine.de>
On Sun, Apr 09, 2006 at 10:11:05AM +0200, Peter Baumann wrote:
Show 57 quoted lines
> On Sat, Apr 08, 2006 at 08:28:58PM +0200, Jakub Narebski wrote:
> > Peter Baumann wrote:
> > 
> > > Another question. I'd like to create a totaly independent branch (like
> > > the "todo" branch in git). Is there a more user friendly way than doing
> > > 
> > > git-checkout -b todo
> > > rm .git/refs/heads/todo
> > > rm .git/index
> > > rm <all_files_in_your_workdir>
> > > 
> > > ... hack hack hack ...
> > > git-commit -a
> > 
> > Wouldn't it be better and more natural to go back to first commit? > 
> 
> If I go back to the first commit, I'll get the following:
> 
> 	first
> 	 / \
> 	/   \
>    master    todo
> 
> That's not what I want, because in the near future I want to merge
> master and todo, but in my case, todo consists of only of one file (lets
> call it file_a), and the master branch has severeal files (file_{a..z}).
> If I go back to first, I have to delete all files file_{b..z}.
> Further file_a from todo and file_a from master are not equal, the share
> just the same name. But in the near future, they will be merged
> together, so they are equal.
> 
> If I go with the above branching, I'll _think_ (I may be wrong, please
> correct me if I am) I get a merge conflict or worse, all my other files
> file_a{b..z} are merged as "deleted", wich is wrong.
> 
> > Or even empty repository state at the beginning, and branch there?
> 
> This isn't possible because the repository already exists and I don't
> know how to go back to the empty repository state. Even 
> 
> 	git-init-db
> 	git branch todo master
> 
> didn't work.
> 
> > Or make separate repository?
> 
> Ok. You got it. In fact, the todo branch alread exists as a seperate
> repository and I'd like to integrate this in my master repository for
> easier handling (diff etc.)
> 
> To import todo as a subproject doesn't seem right, because it's not
> something really independent in the view of the master repo and I'am
> going to merge todo _into_ master in the near future.
> 
> Any further suggestions?
> 

Just in case nobody noticed, that's why I asked for exporting the whole repo with git-format-patch in the first place, because I'd like to import the patches with git-am in the totally independent branch.

Peter
Previous: Peter BaumannNext: Junio C Hamano
Message 6 of 10 in “Can't export whole repo as patches”
  1. Peter BaumannApr 7, 2006
  2. Junio C HamanoApr 7, 2006
  3. How to create independent branchesPeter Baumann, Apr 8, 2006
  4. Jakub NarebskiApr 8, 2006
  5. Peter BaumannApr 9, 2006
  6. Peter BaumannApr 9, 2006
  7. Junio C HamanoApr 8, 2006
  8. Petr BaudisApr 8, 2006
  9. Junio C HamanoApr 8, 2006
  10. Johannes SchindelinApr 8, 2006

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.