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

Pull from one branch to another?

From
JGJeff Garzik <jgarzik@pobox.com>
Date
Sep 29, 2005, 06:07 UTC
Message-ID
<433B84BD.8030003@pobox.com>

I currently use the attached script to merge the contents of one branch into another branch, in my kernel trees:

	$ cd /repo/netdev-2.6
	$ git checkout -f sky2
	$ ... merge patches ...
	$ git checkout -f upstream
	$ ... merge more patches ...
	$ git checkout -f ALL
	$ git-pull-branch upstream
	$ git-pull-branch sky2

End result: 'ALL' branch contains everything in 'sky2' and 'upstream' branches. I use the above for creating an all-inclusive branch that users can test, and that Andrew Morton can pull into his -mm kernel tree.

Right now, my git-pull-branch script (attached) simply calls git-resolve-script, which nicely skips the fetch step and any complications related to that.

My question: is this the best/right way to pull one branch into another? It's been working for me, for months, but...

	Jeff
#!/bin/sh
git-resolve-script HEAD $1 "`pwd` branch '$1'"
Next: Junio C Hamano
Message 1 of 7 in “Pull from one branch to another?”
  1. Jeff GarzikSep 29, 2005
  2. Junio C HamanoSep 29, 2005
  3. Use of the -f flag on checkoutAlan Chandler, Sep 29, 2005
  4. Matthias UrlichsSep 29, 2005
  5. Junio C HamanoSep 29, 2005
  6. Junio C HamanoSep 29, 2005
  7. Tony LuckSep 29, 2005

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.