threads / discuss / 30065

How to setup git repository for internal collaboration, that can be rebased easily?

Subject: How to setup git repository for internal collaboration, that can be rebased easily?

## tl;dr

3 messages between Mar 26, 2012 and Mar 29, 2012.

replies: 2people: 2as markdown or json

Kumar Pande· Mar 26, 2012, 19:08 UTC · lore

Pardon if this embarrassingly simple question, I am new to git haven't found git-newbies mailing list.

We have a situation where we want to setup internal git repository that will be based on say linux-3.3 kernel.

There are about four engineers working on developing things for custom hardware. So would create a development branch say companyx-devel and we will commit all of our changes to this compnayx-devel branch.

We also want to keep upto date with latest kernel, so say if we want to move to latest 3.4-rc4 we could rebase (?) our origin to 3.4-rc4, of course fix any of the conflicts we may find etc.

We are not sure how to  go about setting up the initial import of linux3-3 kernel into git repository on of my local servers?

We know we should do following on the server:

git init --bare git config core.sharedrepository 1

Should we be cloning the linux kernel on the server? git clone path-to-kernel-org-git-tree

Or I should clone the tree from kernel.dot.org client and then push it to my local git repo?

We tried cloning the tree from kernel.dot.org on client and pushing it to our internal server but that doesn't push kernel code as cloned directory already has .git directory.

Is there a document/web page one can refer to that might help us handling this scenario?

-Kumar
Kumar Pande· Mar 27, 2012, 05:50 UTC · re: Kumar Pande · lore

Re: How to setup git repository for internal collaboration, that can be rebased easily?

On Mon, Mar 26, 2012 at 12:08 PM, Kumar Pande <pandekumar023@gmail.com> wrote:
Show 22 quoted lines
> Pardon if this embarrassingly simple question, I am new to git haven't
> found git-newbies mailing list.
>
> We have a situation where we want to setup internal git repository that
> will be based on say linux-3.3 kernel.
>
> There are about four engineers working on developing things for custom
> hardware. So would create a development branch say companyx-devel and we
> will commit all of our changes to this compnayx-devel branch.
>
> We also want to keep upto date with latest kernel, so say if we want to
> move to latest 3.4-rc4 we could rebase (?) our origin to 3.4-rc4, of course
> fix any of the conflicts we may find etc.
>
> We are not sure how to  go about setting up the initial import of linux3-3
> kernel into git repository on of my local servers?
>
> We know we should do following on the server:
>
> git init --bare
> git config core.sharedrepository 1
>
So this what we have done so far:

git clone --bare --shared http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git config core.sharedrepository 1

Now on my client side.
1. I checkout and another user John also cloned this repo using command:
    git clone ssh://gitserver/opt/git/linux.git
2. Now git remote -v shows me
git remote -v
origin	ssh://gitserver/var/git/linux.git (fetch)
origin	ssh://gitserver/var/git/linux.git (push)
3. created a branch
    git branch testbranch
    git checkout testbranch
    <add some files, edited some files, compile & test>
    git commit -am "Testing"
4. Now I push the testbranch to gitserver using
      git push origin testbranch
(this seems to have worked
     To ssh://gitserver/var/git/linux.git
        * [new branch]      testbranch -> testbranch
5. Now another user john  can clone this repo and make changes to this
testbranch, which I can also pull.
So we are good so far.

Now we are not clear or confused about is, say in one week or two weeks linus updates the top of linux.git and if we want to rebase our work to top of that tree. What exactly do we need to do ?

Would REALLY appreciate the help/guidance...
-Kumar
Neal Kreitzinger· Mar 29, 2012, 15:16 UTC · re: Kumar Pande · lore

Re: How to setup git repository for internal collaboration, that can be rebased easily?

On 3/27/2012 12:50 AM, Kumar Pande wrote:
Show 8 quoted lines
> On Mon, Mar 26, 2012 at 12:08 PM, Kumar Pande<pandekumar023@gmail.com>  wrote:
>
> So this what we have done so far:
>
> git clone --bare --shared
> http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git config core.sharedrepository 1
>

I don't think git-clone --shared does what you think it does. You should reread the git-clone manpage for --shared. I haven't used it, but from what I'm reading it doesn't seem to make sense in conjunction with your cloning of git.kernel.org. Either way, it comes with a warning in the manpage: http://schacon.github.com/git/git-clone.html "NOTE: this is a possibly dangerous operation; do not use it unless you understand what it does..."

v/r, neal

← back to recent threads