All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [HOWTO]using git to make a local clone?
@ 2007-06-09  9:55 psr
  2007-06-09 10:19 ` Andi Drebes
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: psr @ 2007-06-09  9:55 UTC (permalink / raw)
  To: kernel-janitors

Hi All,

How can i use git to make a clone of a local kernel src tree?
e.g i want base repo to be my downloaded vanilla kernel 2.6.18.

How can i use git to make this as master, i clone the 2.6.18 src from
my disk to my working directory , modify the kernel ,ass files etc and
then merge with the 2.6.18 src base master which i downloaded.

I am facing trouble fixing this.
All tutorials ask to pull from Linus's latest src tree which i dont
need right now.
Can i use it for the purpose i intend?

Did anybody run into this problem?

pointers or help?

Thanks in advance.

--pradeep
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
@ 2007-06-09 10:19 ` Andi Drebes
  2007-06-09 11:40 ` psr
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Andi Drebes @ 2007-06-09 10:19 UTC (permalink / raw)
  To: kernel-janitors

> How can i use git to make a clone of a local kernel src tree?
> e.g i want base repo to be my downloaded vanilla kernel 2.6.18.
> How can i use git to make this as master, i clone the 2.6.18 src from
> my disk to my working directory , modify the kernel ,ass files etc and
> then merge with the 2.6.18 src base master which i downloaded.
> 
> I am facing trouble fixing this.
> All tutorials ask to pull from Linus's latest src tree which i dont
> need right now.
If you don't need the latest version of the kernel, it doesn't mean that
you don't need Linus' git repo. If you want a specific version of the kernel,
do the following:

1. Clone Linus' git repo (if not already done):
    $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

2. cd to the directoy linux-2.6

3. Every release of the kernel is tagged in the git repo. If you run
    $ git tag -l
    v2.6.11
    v2.6.11-tree
    ....
    v2.6.21
    v2.6.21-rc1
    v2.6.21-rc2
    v2.6.21-rc3
    v2.6.21-rc4
    v2.6.21-rc5
    v2.6.21-rc6
    v2.6.21-rc7
    v2.6.22-rc1
    v2.6.22-rc2
    v2.6.22-rc3
    v2.6.22-rc4
    Then you se all the tags in the current branch. As you've just
    cloned Linus' repo, you will see all the kernel releases. The releases'
    tags are prefix with the character 'v'.

4. Now you want to get the 2.6.18 stable release. You also want to have
    a new branch for you. To do both in a single step, run
    $ git branch mybranch v2.6.18

5. Finally, you want to checkout your new branch to work in it.
    $ git checkout mybranch

And there you are. You have the 2.6.18 vanilla kernel in a repo.
I hope I got you right.

Cheers,
	Andi
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
  2007-06-09 10:19 ` Andi Drebes
@ 2007-06-09 11:40 ` psr
  2007-06-09 11:47 ` psr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: psr @ 2007-06-09 11:40 UTC (permalink / raw)
  To: kernel-janitors

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi Andi,
On 6/9/07, Andi Drebes  wrote:
[snip]
>
> 1. Clone Linus' git repo (if not already done):
>     $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>
> 2. cd to the directoy linux-2.6
>
> 3. Every release of the kernel is tagged in the git repo. If you run
>     $ git tag -l
>     v2.6.11
>     v2.6.11-tree
>     ....
>     v2.6.21
>     v2.6.21-rc1
>     v2.6.21-rc2
>     v2.6.21-rc3
>     v2.6.21-rc4
>     v2.6.21-rc5
>     v2.6.21-rc6
>     v2.6.21-rc7
>     v2.6.22-rc1
>     v2.6.22-rc2
>     v2.6.22-rc3
>     v2.6.22-rc4
>     Then you se all the tags in the current branch. As you've just
>     cloned Linus' repo, you will see all the kernel releases. The releases'
>     tags are prefix with the character 'v'.
>
> 4. Now you want to get the 2.6.18 stable release. You also want to have
>     a new branch for you. To do both in a single step, run
>     $ git branch mybranch v2.6.18
>
> 5. Finally, you want to checkout your new branch to work in it.
>     $ git checkout mybranch
Oh... so its the tags we download first :-).Gee why didn't i find it
in all the tutorials ? :(

>
> And there you are. You have the 2.6.18 vanilla kernel in a repo.
> I hope I got you right.

Right i got you i guess.
I have a doubt now.
I have linux 2.6.18 vanilla kernel already downloaded days back.

What if i do just
$git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Can i now use the already downloaded kernel src somehow instead of
pulling all the 100s of MBs of src from the kernel.org ?

Say i have it in /opt/linux-2.6.18
and i want to use this now after downloading the tags.

I hope i can do this?
I ll try something out.

Thanks
- --pradeep
>
> Cheers,
>         Andi
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: http://firegpg.tuxfamily.org

iD8DBQFGao6uky6Gd9lpXlERAkCxAJ4mjRqnRR5zWYl66ZNfBv1wADFdewCdGenW
m8GVrLsQGXB3U5T/QHuVCp0=6Xxs
-----END PGP SIGNATURE-----
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
  2007-06-09 10:19 ` Andi Drebes
  2007-06-09 11:40 ` psr
@ 2007-06-09 11:47 ` psr
  2007-06-09 12:07 ` psr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: psr @ 2007-06-09 11:47 UTC (permalink / raw)
  To: kernel-janitors

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,
Bad Luck , i am behind a proxy and i can't clone the Linus's tree :-(
I get
  fatal: unable to connect a socket (Connection timed out)
  fetch-pack from
'git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'
    failed.

What to do now?
Any help?

PS: http_proxy variable is exported properly.

thanks
- --pradeep
On 6/9/07, psr  wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Hi Andi,
> On 6/9/07, Andi Drebes  wrote:
> [snip]
> >
> > 1. Clone Linus' git repo (if not already done):
> >     $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> >
> > 2. cd to the directoy linux-2.6
> >
> > 3. Every release of the kernel is tagged in the git repo. If you run
> >     $ git tag -l
> >     v2.6.11
> >     v2.6.11-tree
> >     ....
> >     v2.6.21
> >     v2.6.21-rc1
> >     v2.6.21-rc2
> >     v2.6.21-rc3
> >     v2.6.21-rc4
> >     v2.6.21-rc5
> >     v2.6.21-rc6
> >     v2.6.21-rc7
> >     v2.6.22-rc1
> >     v2.6.22-rc2
> >     v2.6.22-rc3
> >     v2.6.22-rc4
> >     Then you se all the tags in the current branch. As you've just
> >     cloned Linus' repo, you will see all the kernel releases. The releases'
> >     tags are prefix with the character 'v'.
> >
> > 4. Now you want to get the 2.6.18 stable release. You also want to have
> >     a new branch for you. To do both in a single step, run
> >     $ git branch mybranch v2.6.18
> >
> > 5. Finally, you want to checkout your new branch to work in it.
> >     $ git checkout mybranch
> Oh... so its the tags we download first :-).Gee why didn't i find it
> in all the tutorials ? :(
>
> >
> > And there you are. You have the 2.6.18 vanilla kernel in a repo.
> > I hope I got you right.
>
> Right i got you i guess.
> I have a doubt now.
> I have linux 2.6.18 vanilla kernel already downloaded days back.
>
> What if i do just
> $git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>
> Can i now use the already downloaded kernel src somehow instead of
> pulling all the 100s of MBs of src from the kernel.org ?
>
> Say i have it in /opt/linux-2.6.18
> and i want to use this now after downloading the tags.
>
> I hope i can do this?
> I ll try something out.
>
> Thanks
> - --pradeep
> >
> > Cheers,
> >         Andi
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: http://firegpg.tuxfamily.org
>
> iD8DBQFGao6uky6Gd9lpXlERAkCxAJ4mjRqnRR5zWYl66ZNfBv1wADFdewCdGenW
> m8GVrLsQGXB3U5T/QHuVCp0> =6Xxs
> -----END PGP SIGNATURE-----
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: http://firegpg.tuxfamily.org

iD8DBQFGapBNky6Gd9lpXlERAiD3AJ9UQWuxY2BYjStqaxOrr/wx5j5eYwCeMMpw
DsSDRoEWoK59LufwKRt6gNM=+/2S
-----END PGP SIGNATURE-----
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
                   ` (2 preceding siblings ...)
  2007-06-09 11:47 ` psr
@ 2007-06-09 12:07 ` psr
  2007-06-09 12:18 ` Andi Drebes
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: psr @ 2007-06-09 12:07 UTC (permalink / raw)
  To: kernel-janitors

Hi Andi,
[snip]
>
> 3. Every release of the kernel is tagged in the git repo. If you run
>     $ git tag -l
>     v2.6.11
>     v2.6.11-tree
I 'll keep this short and sweet.Since i was unable to download the
tags.I created one for mine downloaded tree using git-tag.
I was able to make one and git-tag -l showed the tag i just made.
I did a git branch kernel-src-2.6.18 v2.6.18 [my tag name is v2.6.18]
And then a git checkout kernel-src-tree

All fine and good.
Now what?
I am still standing in the vanilla tree :-(

I want to make a new dir kernel-src-tree and work there.

What did i miss here now?

thanks
--pradeep
>     ....
>     v2.6.21
>     v2.6.21-rc1
>     v2.6.21-rc2
>     v2.6.21-rc3
>     v2.6.21-rc4
>     v2.6.21-rc5
>     v2.6.21-rc6
>     v2.6.21-rc7
>     v2.6.22-rc1
>     v2.6.22-rc2
>     v2.6.22-rc3
>     v2.6.22-rc4
>     Then you se all the tags in the current branch. As you've just
>     cloned Linus' repo, you will see all the kernel releases. The releases'
>     tags are prefix with the character 'v'.
>
> 4. Now you want to get the 2.6.18 stable release. You also want to have
>     a new branch for you. To do both in a single step, run
>     $ git branch mybranch v2.6.18
>
> 5. Finally, you want to checkout your new branch to work in it.
>     $ git checkout mybranch
>
> And there you are. You have the 2.6.18 vanilla kernel in a repo.
> I hope I got you right.
>
> Cheers,
>         Andi
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
                   ` (3 preceding siblings ...)
  2007-06-09 12:07 ` psr
@ 2007-06-09 12:18 ` Andi Drebes
  2007-06-09 12:51 ` Rene Herman
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Andi Drebes @ 2007-06-09 12:18 UTC (permalink / raw)
  To: kernel-janitors

> Bad Luck , i am behind a proxy and i can't clone the Linus's tree :-(
<snip>
> What to do now?
> Any help?
Did you try to clone the repo via http?
git clone http://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

	Cheers,
		Andi
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
                   ` (4 preceding siblings ...)
  2007-06-09 12:18 ` Andi Drebes
@ 2007-06-09 12:51 ` Rene Herman
  2007-06-09 13:01 ` Rene Herman
  2007-06-09 13:58 ` psr
  7 siblings, 0 replies; 9+ messages in thread
From: Rene Herman @ 2007-06-09 12:51 UTC (permalink / raw)
  To: kernel-janitors

On 06/09/2007 11:43 AM, psr wrote:

> How can i use git to make a clone of a local kernel src tree? e.g i want
> base repo to be my downloaded vanilla kernel 2.6.18.
> 
> How can i use git to make this as master, i clone the 2.6.18 src from my
> disk to my working directory , modify the kernel ,ass files etc and then
> merge with the 2.6.18 src base master which i downloaded.

That final step, "merge with the 2.6.18 src base master" is a bit backwards, 
but sure, you can use git in any local sense that you like. To turn your 
downloaded 2.6.18 kernel into a GIT repo:

$ cd ~/src
$ tar xzf ~/linux-2.6.18.tar.gz
$ mv linux-2.6.18 linux
$ cd linux
$ git init
$ git add .
$ git commit -a -m "initial commit"

You now have a fully functional GIT repository containing the 2.6.18 kernel. 
You can use it directly to do development in; just use branches:

$ git checkout -b local

and start hacking away -- the changes you make will happen on the "local" 
branch and after commiting those (git commit -a) you can switch back to the 
master branch at anytime with "git checkout master", after which you can 
create other branches:

$ git checkout -b work

or decide that local branch sucked after all:

$ git branch -D local

or merge in the work from your local branch into master:

$ git pull . local

or play tetris:

$ git tetris

If you really do want to "double buffer" things though as you're suggesting 
above, you can also after creating the repository first make a local clone 
of it:

$ cd ~/src
$ git clone -l -s linux local

after which you can use that "local" tree as the tree in which you do your 
hacking and branching. A simple "git pull" while in this local tree would 
update from its master which is the "linux" tree you created.

> I am facing trouble fixing this. All tutorials ask to pull from Linus's
> latest src tree which i dont need right now. Can i use it for the purpose
> i intend?

Yes. GIT's most profound problem seems to be that you can use for basically 
any purpose. Advice: don't try to pin down an entire workflow right from the 
start; just start using it, and learning what it can do as you go along, and 
more importantly, learning what you _want_ it to do as you go along.

Specifically, you're really best of ignoring all the stuff above about 
setting up that local repo and just clone the master linux repo. You need to 
do that only once and afterwards, you can just merrily update through simple 
"git pull" commands. So, I'd suggest:

$ cd ~/src
$ git clone -n 
git://git2.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linus

I hope that wordwraps in non too awkward positions. It clones the master 
linux GIT repo into a local directory called "linus" and the -n makes it not 
checkout after the clone.

Yes, this is fetching lots of data and will certainly take a while if you're 
on a slow connection. As said, you only have to do it once though. Once it 
completes, you can (just in case) back up that initial repository clone 
simply with a "tar cf linus-20070609.tar linus" after which you can start 
from that point again for ever more.

Then, you can work directly in that repo using branches, or again double 
buffer by cloning it locally once more:

$ git clone -l -s linus local

and work in that tree. A "git pull"  from the "local" repository would 
update from the "linus" repository on your own disk, and a "git pull" from 
the "linus" repository would update from linus' repository at the above 
mentioned url.

Hope this was somewhat useful but as a PS -- this question was more for the 
kernelnewbies mailing list than the kernel janitors. Kernelnewbies seems to 
be dwindling a bit lately which seems a shame. I'm crossposting this there.

Subscription info at: http://kernelnewbies.org/MailingList

Let's keep it alive.

Rene.

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
                   ` (5 preceding siblings ...)
  2007-06-09 12:51 ` Rene Herman
@ 2007-06-09 13:01 ` Rene Herman
  2007-06-09 13:58 ` psr
  7 siblings, 0 replies; 9+ messages in thread
From: Rene Herman @ 2007-06-09 13:01 UTC (permalink / raw)
  To: kernel-janitors

On 06/09/2007 02:51 PM, Rene Herman wrote:

> Specifically, you're really best of ignoring all the stuff above about 
> setting up that local repo and just clone the master linux repo. You 
> need to do that only once and afterwards, you can just merrily update 
> through simple "git pull" commands. So, I'd suggest:
> 
> $ cd ~/src
> $ git clone -n 
> git://git2.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linus

Just saw you posting proxy information -- the only thing that should change 
is replacing this GIT url with:

http://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Rene.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [KJ] [HOWTO]using git to make a local clone?
  2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
                   ` (6 preceding siblings ...)
  2007-06-09 13:01 ` Rene Herman
@ 2007-06-09 13:58 ` psr
  7 siblings, 0 replies; 9+ messages in thread
From: psr @ 2007-06-09 13:58 UTC (permalink / raw)
  To: kernel-janitors

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Rene and Andy,

Thanks a lot.
I figured it out while expermenting around with git:-).

Now i since i have done this i have posted the results on my blog.

These are the steps i followed.
generate the tag locally if you cannot download one. In fact its not
compulsion to downlaod tags to start with i guess.They are important
if you want to keep up with latest linux tree though.

I did :-

$ git add .
$ git commit
$ git tag -f v2.6.xyz-mine
$ git tag -l
$ git branch devel-branch v2.6.xyz-mine
$ git checkout devel-branch
$ git branch

and i am done. No need to donwload any tags or 300MB of src. Just
generate tag locally and yay...

Thanks Rene, Thanks Andy.

Cheers
- --pradeep

[ http://psrautela.blogspot.com ]

On 6/9/07, Rene Herman  wrote:
> On 06/09/2007 02:51 PM, Rene Herman wrote:
>
> > Specifically, you're really best of ignoring all the stuff above about
> > setting up that local repo and just clone the master linux repo. You
> > need to do that only once and afterwards, you can just merrily update
> > through simple "git pull" commands. So, I'd suggest:
> >
> > $ cd ~/src
> > $ git clone -n
> > git://git2.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linus
>
> Just saw you posting proxy information -- the only thing that should change
> is replacing this GIT url with:
>
> http://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>
> Rene.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: http://firegpg.tuxfamily.org

iD8DBQFGaq79ky6Gd9lpXlERApS3AJ0RhbjNTdxRm2dc99YyTRBD/1+RFgCfUix0
et4MJV8z5LoUhBY/gUy8OGM=R9/e
-----END PGP SIGNATURE-----
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-06-09 13:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-09  9:55 [KJ] [HOWTO]using git to make a local clone? psr
2007-06-09 10:19 ` Andi Drebes
2007-06-09 11:40 ` psr
2007-06-09 11:47 ` psr
2007-06-09 12:07 ` psr
2007-06-09 12:18 ` Andi Drebes
2007-06-09 12:51 ` Rene Herman
2007-06-09 13:01 ` Rene Herman
2007-06-09 13:58 ` psr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.