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

Re: Merge *to* branch instead of merge *from* branch?

From
KWKelvie Wong <kelvie@ieee.org>
Date
Apr 27, 2008, 02:19 UTC
Message-ID
<94ccbe710804261919u5aa5406cnd26f2eb4ff44990a@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0804270037220.1149@perkele.intern.softwolves.pp.se>
On Sat, Apr 26, 2008 at 3:42 PM, Peter Karlsson <peter@softwolves.pp.se> wrote:
Show 17 quoted lines
> Hi!
>
>  My most common use-case of Git is currently somewhere along the lines of
>
>   git checkout master # start from here
>   git checkout -b new_branch
>   ...edit...
>   ...commit...
>   git merge master # to make sure I have the latest changes
>   ...make sure it all works...
>   git checkout master
>   git merge new_branch # fast-forwards master to new_branch's HEAD
>
>  Is there any way of not having to do the "git checkout master" first?
> Basically I want a flag to merge or checkout saying that I want to merge my
> branch into the branch I'm switching to. I can't seem to find any such flag.
>
I believe what you are looking for is in in the "push" command.
git push . new_branch:master # pushes your changes into master.
-- 
Kelvie Wong
Previous: Avery Pennarun
Message 3 of 3 in “Merge *to* branch instead of merge *from* branch?”
  1. Peter KarlssonApr 26, 2008
  2. Avery PennarunApr 26, 2008
  3. Kelvie WongApr 27, 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.