creating a new git branch

Submitted by tthtlc
on February 28, 2008 - 11:07pm

sorry if i misunderstood git...

1. i created a new git branch "git checkout -b newbranch", but what does that mean? currently the master is at 2.6.25-rc3, but if I checkout and switch to this new branch with this command, the new branch will be at this new version, correct?

2. at the newbranch, how do i downgrade the version to 2.6.24, since "git tags" listed this as one of the tags?

i am very confused with the clone, checkout, branch etc feature.

thanks..

Re: creating a new git branch

k_amlie (not verified)
on
February 29, 2008 - 3:31am

First you checkout your new branch by doing "git checkout newbranch" (it looks like you already did that).
Then you "move" the branch you are on to the correct tag using "git reset --hard 2.6.24". 2.6.24 can be replaced with any tag, branch or commit name.

Re: creating a new git branch

tthtlc
on
March 1, 2008 - 7:58am

Thank you amlie, I solved my problem too....

It is via "git checkout v2.6.24 .", where the "." will trigger a "git ls-files" (from my ps -ef I can see) to enumerate all the git repository, and overwrite it with the old version.

Now I just want to make a new copy of this version, so I used "git ls-files" to enumerate all the files and copy it to the new directory. Thanks :-).

git checkout -b newbranch

Anonymous (not verified)
on
March 3, 2008 - 4:41pm

git checkout -b newbranch v2.6.24

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.