* question git & branches
@ 2005-08-29 8:07 Ben Greear
2005-08-29 11:27 ` Martin Langhoff
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ben Greear @ 2005-08-29 8:07 UTC (permalink / raw)
To: git
Hello!
I've been trying out git and have some questions...
I installed the latest snapshot of git, pulled down the
kernel (2.6.13-rc7), and started hacking. What fun...got myself
a git patch and was happy.
Then, decided I wanted to branch off my changes from the
main tree so I could maintain the patch-set separate for
this particular feature.
I created a new branch 'ben_dev_rfcnt'.
Now, I also have another patch that I wanted to pull into git.
Before merging this, I created another branch 'foo'.
I changed to this branch foo and imported my patch and resolved the
conflicts, etc.
I think I'm missing something fundamental though... I wanted to
change to the ben_dev_rfcnt branch to build a kernel without my
additional patch. git branch ben_dev_rfcnt seems to change
it fine, but all of the changes for repository 'foo' are also
still here.
Am I completely missing how branches work, or just missing a few
commands?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 8:07 question git & branches Ben Greear
@ 2005-08-29 11:27 ` Martin Langhoff
2005-08-29 12:15 ` Alex Riesen
2005-08-29 15:03 ` Linus Torvalds
2 siblings, 0 replies; 7+ messages in thread
From: Martin Langhoff @ 2005-08-29 11:27 UTC (permalink / raw)
To: Ben Greear; +Cc: git
On 8/29/05, Ben Greear <greearb@candelatech.com> wrote:
> I created a new branch 'ben_dev_rfcnt'.
>
> Now, I also have another patch that I wanted to pull into git.
>
> Before merging this, I created another branch 'foo'.
>
> I changed to this branch foo and imported my patch and resolved the
> conflicts, etc.
Are you using git-checkout to change branches? If you have cogito
installed, cg-status is a good, handy way of confirming you are where
you expect to be.
You can also do git-show-branch{,es-script}
cheers,
martin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 8:07 question git & branches Ben Greear
2005-08-29 11:27 ` Martin Langhoff
@ 2005-08-29 12:15 ` Alex Riesen
2005-08-29 15:03 ` Linus Torvalds
2 siblings, 0 replies; 7+ messages in thread
From: Alex Riesen @ 2005-08-29 12:15 UTC (permalink / raw)
To: Ben Greear; +Cc: git
On 8/29/05, Ben Greear <greearb@candelatech.com> wrote:
> I think I'm missing something fundamental though... I wanted to
> change to the ben_dev_rfcnt branch to build a kernel without my
> additional patch. git branch ben_dev_rfcnt seems to change
> it fine, but all of the changes for repository 'foo' are also
> still here.
You probably looking for "get reset --hard master", which should bring the
working tree in sync with cache, but being new to git myself, I'm not sure.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 8:07 question git & branches Ben Greear
2005-08-29 11:27 ` Martin Langhoff
2005-08-29 12:15 ` Alex Riesen
@ 2005-08-29 15:03 ` Linus Torvalds
2005-08-29 17:49 ` Ben Greear
2005-08-29 20:20 ` Jon Loeliger
2 siblings, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2005-08-29 15:03 UTC (permalink / raw)
To: Ben Greear; +Cc: git
On Mon, 29 Aug 2005, Ben Greear wrote:
>
> I think I'm missing something fundamental though... I wanted to
> change to the ben_dev_rfcnt branch to build a kernel without my
> additional patch. git branch ben_dev_rfcnt seems to change
> it fine, but all of the changes for repository 'foo' are also
> still here.
"git branch" just creates the branch, it doesn't actually do anything
else. Use "git checkout <branchname>" to switch to it.
You can do both with "bit checkout -b <branchname>" which both creates the
branch and switches to it.
(Both "git branch" and "git checkout -b <branchname>" that reate a new
branch take an optional argument which says what point you want the branch
to start at. It defaults to "current state", but you can create a branch
at any point in the history by just explicitly stating the commit name
that you want to start off with as the head of the branch)
Use "gitk --all" to visualize where the different branches are in the
history, and a plain "git branch" with no arguments to list the branches
and mark your currently active branch.
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 15:03 ` Linus Torvalds
@ 2005-08-29 17:49 ` Ben Greear
2005-08-29 18:04 ` Linus Torvalds
2005-08-29 20:20 ` Jon Loeliger
1 sibling, 1 reply; 7+ messages in thread
From: Ben Greear @ 2005-08-29 17:49 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
Linus Torvalds wrote:
>
> On Mon, 29 Aug 2005, Ben Greear wrote:
>
>>I think I'm missing something fundamental though... I wanted to
>>change to the ben_dev_rfcnt branch to build a kernel without my
>>additional patch. git branch ben_dev_rfcnt seems to change
>>it fine, but all of the changes for repository 'foo' are also
>>still here.
>
>
> "git branch" just creates the branch, it doesn't actually do anything
> else. Use "git checkout <branchname>" to switch to it.
I tried 'git checkout ben_dev_rfcnt'. It took a few seconds and
had no errors. But, the files created on my other branch still
exist in the code tree, and I still see my patch in the
existing files.. I would expect them to go away.
I don't think I've managed to commit anything to any branch yet... Could that
be part of the problem?
I tried gitk -all, and get this error popup:
Gitk: error reading commits: bad arguments to git-rev-list.
(Note: arguments to gitk are passed to
git-rev-list
to allow selection of commits to be displayed.)
Thanks,
Ben
> You can do both with "bit checkout -b <branchname>" which both creates the
> branch and switches to it.
>
> (Both "git branch" and "git checkout -b <branchname>" that reate a new
> branch take an optional argument which says what point you want the branch
> to start at. It defaults to "current state", but you can create a branch
> at any point in the history by just explicitly stating the commit name
> that you want to start off with as the head of the branch)
>
> Use "gitk --all" to visualize where the different branches are in the
> history, and a plain "git branch" with no arguments to list the branches
> and mark your currently active branch.
>
> Linus
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 17:49 ` Ben Greear
@ 2005-08-29 18:04 ` Linus Torvalds
0 siblings, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2005-08-29 18:04 UTC (permalink / raw)
To: Ben Greear; +Cc: git
On Mon, 29 Aug 2005, Ben Greear wrote:
>
> I tried 'git checkout ben_dev_rfcnt'. It took a few seconds and
> had no errors. But, the files created on my other branch still
> exist in the code tree, and I still see my patch in the
> existing files.. I would expect them to go away.
>
> I don't think I've managed to commit anything to any branch yet... Could that
> be part of the problem?
Yes. If you haven't committed anything, then the dirty state follows you
to the other branch (unless the branch differs in the dirty files, in
which case "git checkout" will refuse with a hopefully quite
understandable error message).
> I tried gitk -all, and get this error popup:
Double dashes: "gitk --all".
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: question git & branches
2005-08-29 15:03 ` Linus Torvalds
2005-08-29 17:49 ` Ben Greear
@ 2005-08-29 20:20 ` Jon Loeliger
1 sibling, 0 replies; 7+ messages in thread
From: Jon Loeliger @ 2005-08-29 20:20 UTC (permalink / raw)
To: Git List
On Mon, 2005-08-29 at 10:03, Linus Torvalds wrote:
> (Both "git branch" and "git checkout -b <branchname>" that reate a new
This of course, is Git's answer to the long standing
UNIX tradition. Whereas UNIX would creat() files,
Git will reate() branches.
> Linus
jdl
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-08-29 20:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-29 8:07 question git & branches Ben Greear
2005-08-29 11:27 ` Martin Langhoff
2005-08-29 12:15 ` Alex Riesen
2005-08-29 15:03 ` Linus Torvalds
2005-08-29 17:49 ` Ben Greear
2005-08-29 18:04 ` Linus Torvalds
2005-08-29 20:20 ` Jon Loeliger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).