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

Re: branching and supporting a tagged kernel version

From
Junio C Hamano <junkio@cox.net>
Date
Dec 12, 2005, 22:37 UTC
Message-ID
<7virtueycd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<68948ca0512121331x13bfb691t62224d02ced04a27@mail.gmail.com>
Don Zickus <dzickus@gmail.com> writes:
Show 5 quoted lines
> So my questions (for now) are:
>
> 1) what is the easiest way to branch off on a tagged version (in this
> case 2.6.14)?  I didn't quite understand what <starting point>
> referred to in the git-branch docs.

Starting point is badly worded, but essentially it means "anything that names a particular commit". That's the commit you want to base your branch off of.

In your case, you would run:

------------ $ git clone git://git.kernel.org/pub/.../torvalds/linux-2.6/ my2.6 $ cd my2.6 $ git checkout -b private v2.6.14 ------------

to create and checkout a branch called "private" to house your personal changes, based on v2.6.14. Your working tree is based on v2.6.14 and you are on the "private" branch immediately after this operation, and you should see no diff from either of these commands:

------------ $ git diff v2.6.14 <1> $ git diff private v2.6.14 <2>

<1> compare your work tree with v2.6.14 tagged by Linus <2> compare "private" branch head with v2.6.14 tagged by Linus ------------

Then work as usual, the cycle is:

------------ $ edit $ git diff ;# to see how well you are doing $ compile $ test $ git diff HEAD ;# final review before committing $ git commit -a ;# commit all changes as you tested ------------

> 2) is there a way to get a list of commits from upstream that are not
> in my branch and then selectively apply them?  Yes, I understand the
> potential merge mess...

I'll refrain from saying that it is not the usual way to work with git, since you seem to know what you are doing. So let's assume that you somehow do not ever want to merge from Linus head into the "private" branch.

After you have worked there:

------------ $ git fetch origin $ git cherry origin private ------------

would show the list of commits since you forked from origin, which is Linus head --- when you run "git clone" to set up "my2.6" repository, it would have made .git/remotes/origin shorthand that has this line in it:

------------
URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/
Pull: master:origin
------------
pick the ones you want, and apply them with:

------------ $ git cherry-pick 12233445.... ------------

Previous: Don ZickusNext: Don Zickus
Message 2 of 4 in “branching and supporting a tagged kernel version”
  1. Don ZickusDec 12, 2005
  2. Junio C HamanoDec 12, 2005
  3. Don ZickusDec 12, 2005
  4. Petr BaudisDec 13, 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.