{"thread":{"id":"1686","subject":"question git & branches","startedAt":"2005-08-29T08:07:42Z","lastAt":"2005-08-29T20:20:54Z","messageCount":7,"participants":["Ben Greear","Martin Langhoff","Alex Riesen","Linus Torvalds","Jon Loeliger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7890","messageId":"4312C24E.4000803@candelatech.com","threadId":"1686","inReplyTo":null,"subject":"question git & branches","fromName":"Ben Greear","fromEmail":"greearb@candelatech.com","sentAt":"2005-08-29T08:07:42Z","receivedAt":"2005-08-29T08:07:42Z","isPatch":false,"sender":{"key":"greearb@candelatech.com","avatar":null},"body":"Hello!\n\nI've been trying out git and have some questions...\n\nI installed the latest snapshot of git, pulled down the\nkernel (2.6.13-rc7), and started hacking.  What fun...got myself\na git patch and was happy.\n\nThen, decided I wanted to branch off my changes from the\nmain tree so I could maintain the patch-set separate for\nthis particular feature.\n\nI created a new branch 'ben_dev_rfcnt'.\n\nNow, I also have another patch that I wanted to pull into git.\n\nBefore merging this, I created another branch 'foo'.\n\nI changed to this branch foo and imported my patch and resolved the\nconflicts, etc.\n\nI think I'm missing something fundamental though...  I wanted to\nchange to the ben_dev_rfcnt branch to build a kernel without my\nadditional patch.  git branch ben_dev_rfcnt seems to change\nit fine, but all of the changes for repository 'foo' are also\nstill here.\n\nAm I completely missing how branches work, or just missing a few\ncommands?\n\nThanks,\nBen\n\n-- \nBen Greear <greearb@candelatech.com>\nCandela Technologies Inc  http://www.candelatech.com\n"},{"id":"7896","messageId":"46a038f90508290427236e261b@mail.gmail.com","threadId":"1686","inReplyTo":"4312C24E.4000803@candelatech.com","subject":"Re: question git & branches","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-08-29T11:27:12Z","receivedAt":"2005-08-29T11:27:12Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 8/29/05, Ben Greear <greearb@candelatech.com> wrote:\n> I created a new branch 'ben_dev_rfcnt'.\n> \n> Now, I also have another patch that I wanted to pull into git.\n> \n> Before merging this, I created another branch 'foo'.\n> \n> I changed to this branch foo and imported my patch and resolved the\n> conflicts, etc.\n\nAre you using git-checkout to change branches? If you have cogito\ninstalled, cg-status is a good, handy way of confirming you are where\nyou expect to be.\n\nYou can also do git-show-branch{,es-script}\n\ncheers,\n\n\nmartin\n"},{"id":"7897","messageId":"81b0412b050829051514bf02f2@mail.gmail.com","threadId":"1686","inReplyTo":"4312C24E.4000803@candelatech.com","subject":"Re: question git & branches","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-08-29T12:15:51Z","receivedAt":"2005-08-29T12:15:51Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 8/29/05, Ben Greear <greearb@candelatech.com> wrote:\n> I think I'm missing something fundamental though...  I wanted to\n> change to the ben_dev_rfcnt branch to build a kernel without my\n> additional patch.  git branch ben_dev_rfcnt seems to change\n> it fine, but all of the changes for repository 'foo' are also\n> still here.\n\nYou probably looking for \"get reset --hard master\",  which should bring the \nworking tree in sync with cache, but being new to git myself, I'm not sure.\n"},{"id":"7898","messageId":"Pine.LNX.4.58.0508290754410.3243@g5.osdl.org","threadId":"1686","inReplyTo":"4312C24E.4000803@candelatech.com","subject":"Re: question git & branches","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-29T15:03:58Z","receivedAt":"2005-08-29T15:03:58Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 29 Aug 2005, Ben Greear wrote:\n> \n> I think I'm missing something fundamental though...  I wanted to\n> change to the ben_dev_rfcnt branch to build a kernel without my\n> additional patch.  git branch ben_dev_rfcnt seems to change\n> it fine, but all of the changes for repository 'foo' are also\n> still here.\n\n\"git branch\" just creates the branch, it doesn't actually do anything\nelse. Use \"git checkout <branchname>\" to switch to it.\n\nYou can do both with \"bit checkout -b <branchname>\" which both creates the \nbranch and switches to it.\n\n(Both \"git branch\" and \"git checkout -b <branchname>\" that reate a new\nbranch take an optional argument which says what point you want the branch\nto start at. It defaults to \"current state\", but you can create a branch\nat any point in the history by just explicitly stating the commit name\nthat you want to start off with as the head of the branch)\n\nUse \"gitk --all\" to visualize where the different branches are in the \nhistory, and a plain \"git branch\" with no arguments to list the branches \nand mark your currently active branch.\n\n\t\t\t\tLinus\n"},{"id":"7906","messageId":"43134AA3.2010308@candelatech.com","threadId":"1686","inReplyTo":"Pine.LNX.4.58.0508290754410.3243@g5.osdl.org","subject":"Re: question git & branches","fromName":"Ben Greear","fromEmail":"greearb@candelatech.com","sentAt":"2005-08-29T17:49:23Z","receivedAt":"2005-08-29T17:49:23Z","isPatch":false,"sender":{"key":"greearb@candelatech.com","avatar":null},"body":"Linus Torvalds wrote:\n> \n> On Mon, 29 Aug 2005, Ben Greear wrote:\n> \n>>I think I'm missing something fundamental though...  I wanted to\n>>change to the ben_dev_rfcnt branch to build a kernel without my\n>>additional patch.  git branch ben_dev_rfcnt seems to change\n>>it fine, but all of the changes for repository 'foo' are also\n>>still here.\n> \n> \n> \"git branch\" just creates the branch, it doesn't actually do anything\n> else. Use \"git checkout <branchname>\" to switch to it.\n\nI tried 'git checkout ben_dev_rfcnt'.  It took a few seconds and\nhad no errors.  But, the files created on my other branch still\nexist in the code tree, and I still see my patch in the\nexisting files..  I would expect them to go away.\n\nI don't think I've managed to commit anything to any branch yet...  Could that\nbe part of the problem?\n\nI tried gitk -all, and get this error popup:\n\nGitk: error reading commits: bad arguments to git-rev-list.\n(Note: arguments to gitk are passed to\ngit-rev-list\nto allow selection of commits to be displayed.)\n\nThanks,\nBen\n\n> You can do both with \"bit checkout -b <branchname>\" which both creates the \n> branch and switches to it.\n> \n> (Both \"git branch\" and \"git checkout -b <branchname>\" that reate a new\n> branch take an optional argument which says what point you want the branch\n> to start at. It defaults to \"current state\", but you can create a branch\n> at any point in the history by just explicitly stating the commit name\n> that you want to start off with as the head of the branch)\n> \n> Use \"gitk --all\" to visualize where the different branches are in the \n> history, and a plain \"git branch\" with no arguments to list the branches \n> and mark your currently active branch.\n> \n> \t\t\t\tLinus\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n\n\n-- \nBen Greear <greearb@candelatech.com>\nCandela Technologies Inc  http://www.candelatech.com\n"},{"id":"7908","messageId":"Pine.LNX.4.58.0508291103010.3243@g5.osdl.org","threadId":"1686","inReplyTo":"43134AA3.2010308@candelatech.com","subject":"Re: question git & branches","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-29T18:04:23Z","receivedAt":"2005-08-29T18:04:23Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 29 Aug 2005, Ben Greear wrote:\n> \n> I tried 'git checkout ben_dev_rfcnt'.  It took a few seconds and\n> had no errors.  But, the files created on my other branch still\n> exist in the code tree, and I still see my patch in the\n> existing files..  I would expect them to go away.\n> \n> I don't think I've managed to commit anything to any branch yet...  Could that\n> be part of the problem?\n\nYes. If you haven't committed anything, then the dirty state follows you\nto the other branch (unless the branch differs in the dirty files, in\nwhich case \"git checkout\" will refuse with a hopefully quite\nunderstandable error message).\n\n> I tried gitk -all, and get this error popup:\n\nDouble dashes: \"gitk --all\".\n\n\t\tLinus\n"},{"id":"7920","messageId":"1125346853.7206.2.camel@cashmere.sps.mot.com","threadId":"1686","inReplyTo":"Pine.LNX.4.58.0508290754410.3243@g5.osdl.org","subject":"Re: question git & branches","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2005-08-29T20:20:54Z","receivedAt":"2005-08-29T20:20:54Z","isPatch":false,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Mon, 2005-08-29 at 10:03, Linus Torvalds wrote:\n\n> (Both \"git branch\" and \"git checkout -b <branchname>\" that reate a new\n\nThis of course, is Git's answer to the long standing\nUNIX tradition.  Whereas UNIX would creat() files,\nGit will reate() branches.\n\n> \t\t\t\tLinus\n\njdl\n"}]}