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
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.
??????
Thanks klaus
On Nov 05, 2009 at 19:44, Klaus Darilion klaus.mailinglists@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
Andrei Pelinescu-Onciul schrieb:
On Nov 05, 2009 at 19:44, Klaus Darilion klaus.mailinglists@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
Thanks for the instructions, up to here it worked.
git pull --rebase --ff origin/sr_3.0 (in case you're on sr_3.0)
This causes (I am on sr_3.0): $ git pull --rebase --ff origin/sr_3.0 fatal: 'origin/sr_3.0': unable to chdir or not a git archive fatal: The remote end hung up unexpectedly
regards Klaus
PS: What is "origin"?
or git pull --rebase --ff origin/master (in case you're on master)
Andrei
On Nov 06, 2009 at 10:44, Klaus Darilion klaus.mailinglists@pernau.at wrote:
Andrei Pelinescu-Onciul schrieb:
On Nov 05, 2009 at 19:44, Klaus Darilion klaus.mailinglists@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
Thanks for the instructions, up to here it worked.
git pull --rebase --ff origin/sr_3.0 (in case you're on sr_3.0)
^^^^^^^^^^^^ sorry, origin sr_3.0: git pull --rebase --ff origin sr_3.0 (in case you're on sr_3.0)
This causes (I am on sr_3.0): $ git pull --rebase --ff origin/sr_3.0 fatal: 'origin/sr_3.0': unable to chdir or not a git archive fatal: The remote end hung up unexpectedly
regards Klaus
PS: What is "origin"?
The origin repository. By default it's the place from where you cloned (you can add more repositories or change them if you want). For example in my local "clone" I have added another repository for ser (which contains ser cvs sync'ed to git and points to git://git.sip-router.org/ser) and if someone makes a change on it, all I have to do to merge it is: git pull ser cvs-head (note that in this case I want a merge not and "update" so I don't add --rebase) or git fetch ser; git merge ser/cvs-head (what I really do to sync with ser is slightly different: I do the merge like above, but I merge into the cvs-head branch and then I merge origin/cvs-head into master).
The repository name is just a "shortcut", instead of it you could specify the full path/url e.g.: git//git.sip-router.org/sip-router or ssh://user@/git.sip-router.org/sip-router.
git branch -a will show you both your local branches and the remote branches prefixed by the repository name, e.g.: origin/sr_3.0 origin/master a.s.o.
Andrei