# keeping -RT and mainline tree in single repository

2 messages from 2011-04-08 to 2011-04-08. Participants: Tharindu Rukshan Bamunuarachchi, Ramkumar Ramachandra.
Thread: https://gitlist.dev/t/27035

## Tharindu Rukshan Bamunuarachchi, 2011-04-08 07:03

Subject: keeping -RT and mainline tree in single repository
Message-ID: <BANLkTikGMG76QhLaGfs-m-SizcaqnZ0mhA@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTikGMG76QhLaGfs-m-SizcaqnZ0mhA%40mail.gmail.com

```
hi All,

at the moment i am pulling latest source from
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
and keep my driver development up-to-date with mainline.

i need to port my driver to -rt also.

1. do i have to pull and use another git repository from RT GIT. i.e.
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
2. how can i use current GIT repository to keep sync with both -RT and
mainline ?
3. how can i pull latest commits without switching between branches. (
i hv two branches ... master & my-own-hacked). Every time i switch to
master and pull latest code.

Really appreciate if you can point howto/resource ?

Thanks in advance
__
Tharindu "R" Bamunuarachchi.

```

## Ramkumar Ramachandra, 2011-04-08 07:52

Subject: Re: keeping -RT and mainline tree in single repository
Message-ID: <20110408075217.GA25171@kytes>
URL: https://gitlist.dev/e/20110408075217.GA25171%40kytes
In-Reply-To: <BANLkTikGMG76QhLaGfs-m-SizcaqnZ0mhA@mail.gmail.com>

```
Hi Tharindu,

Tharindu Rukshan Bamunuarachchi writes:
> at the moment i am pulling latest source from
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> and keep my driver development up-to-date with mainline.
> 
> i need to port my driver to -rt also.
> 
> 1. do i have to pull and use another git repository from RT GIT. i.e.
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
> 2. how can i use current GIT repository to keep sync with both -RT and
> mainline ?

You just need two remotes -- simply run `git remote add rt
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git`
to add this remote.  Then, `git fetch --all` to fetch from all
remotes.

> 3. how can i pull latest commits without switching between branches. (
> i hv two branches ... master & my-own-hacked). Every time i switch to
> master and pull latest code.

A `pull` is a `fetch` plus an additional action depending on the
switches and the situation (merge, merge with rebase, ff merge etc).
You can run `fetch`, irrespective of the branch you're on.  However,
you need to switch branches to perform a `merge` operation, because of
the way it works.

Hope that helps.

-- Ram

```
