[sr-dev] git problem: "svn up" sr_3.0 branch

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Nov 5 21:19:27 CET 2009


On Nov 05, 2009 at 19:44, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
> Hi!
> 
> Once again I fail to use git - hope someone can help me. I just want to 
> have a local copy of sr_3.0 branch for testing.
> 
> So, first I cloned the repository:
> git clone git://git.sip-router.org/sip-router
> 
> Then I made a local branch to follow the remote branch:
> git checkout --track -b sr_3.0

If you want to track sr_3.0 then you should have used:
git checkout --track -b sr_3.0 origin/sr_3.0

What you did is to track the current branch, which is master after a
fresh clone, so you ended up with your local sr_3.0 tracking master.

There's no need to create a separate "clone" for sr_3.0, you can use the
same clone for all the branches, and just switch between them with
git checkout <branch> (it's extremely fast).

> 
> This worked fine, I built and installed sip-router.
> 
> Now, as there were some commits today, I wanted to update my local 
> branch. How? I tried a simple "git pull" but it always says:
>  From .
>   * branch            master     -> FETCH_HEAD
>  Already up-to-date.
> 
> ??????

If you don't have any changes/local commits on your local sr_3.0, do the
following:

git checkout master # just to change the branch
git branch -D sr_3.0 # deletes sr_3.0
git checkout --track -b sr_3.0 origin/sr_3.0 # recreate sr_3.0 tracking 
                                             # origin/sr_3.0

BTW: always add --rebase to git pull, to avoid useless merge commit 
messages (you need to add --rebase only if you did some local commits,
but it doesn't hurt and it's simpler to use it always).
The safest way to pull is:
git fetch origin
git pull --rebase --ff origin/sr_3.0 (in case you're on sr_3.0)

or 
git pull --rebase --ff origin/master (in case you're on master)


Andrei



More information about the sr-dev mailing list