a week ago i created a new head jh/mtree, which is supposed to track master:
git checkout --track -b mtree master git push origin mtree:jh/mtree
now when i browse that head on gitweb page, i don't see any changes done to master, such as the one i did today on lib/srdb1/schema/entities.xml.
what does "tracking master" mean? how can i see changes done on master on jh/mtree head?
-- juha
On Thursday 08 September 2011, Juha Heinanen wrote:
a week ago i created a new head jh/mtree, which is supposed to track master:
git checkout --track -b mtree master git push origin mtree:jh/mtree
now when i browse that head on gitweb page, i don't see any changes done to master, such as the one i did today on lib/srdb1/schema/entities.xml.
what does "tracking master" mean? how can i see changes done on master on jh/mtree head?
It just means that master is the default upstream branch. So you don't have to enter any branch when pulling. When in you mtree branch, 'git pull' will pull changes from master.
From git-branch manpage:
-t, --track When creating a new branch, set up configuration to mark the start-point branch as "upstream" from the new branch. This configuration will tell git to show the relationship between the two branches in git status and git branch - v. Furthermore, it directs git pull without arguments to pull from the upstream when the new branch is checked out.
This behavior is the default when the start point is a remote-tracking branch. Set the branch.autosetupmerge configuration variable to false if you want git checkout and git branch to always behave as if --no-track were given. Set it to always if you want this behavior when the start-point is either a local or remote-tracking branch.
Alex Hermann writes:
When in you mtree branch, 'git pull' will pull changes from master.
alex,
thank you for your answer. i thought too that it works like than, but it doesn't.
just to make sure, i just cloned sip-router again:
/usr/src/orig$ mkdir sip-router /usr/src/orig$ git clone ssh://jh@git.sip-router.org/sip-router Cloning into sip-router... jh@git.sip-router.org's password: Receiving objects: 24% (30355/123106), 14.38 MiB | 355 KiB/s remote: Total 123106 (delta 86469), reused 117147 (delta 81991) Receiving objects: 100% (123106/123106), 31.57 MiB | 295 KiB/s, done. Resolving deltas: 100% (86469/86469), done.
then i created a local branch called 'jh' that tracks remote head jh/mtree:
/usr/src/orig/sip-router$ git checkout --track -b jh remotes/origin/jh/mtree Branch jh set up to track remote branch jh/mtree from origin. Switched to a new branch 'jh'
then i do pull:
/usr/src/orig/sip-router$ eg pull jh@git.sip-router.org's password: Already up-to-date.
and after that lib/srdb1/schema/entities.xml does not contain the change that i did to master this morning.
-- juha
On Thursday 08 September 2011, Juha Heinanen wrote:
Alex Hermann writes:
When in you mtree branch, 'git pull' will pull changes from master.
alex,
thank you for your answer. i thought too that it works like than, but it doesn't.
Is local mtree branch supposed to track master?
just to make sure, i just cloned sip-router again:
/usr/src/orig$ mkdir sip-router /usr/src/orig$ git clone ssh://jh@git.sip-router.org/sip-router Cloning into sip-router... jh@git.sip-router.org's password: Receiving objects: 24% (30355/123106), 14.38 MiB | 355 KiB/s remote: Total 123106 (delta 86469), reused 117147 (delta 81991) Receiving objects: 100% (123106/123106), 31.57 MiB | 295 KiB/s, done. Resolving deltas: 100% (86469/86469), done.
then i created a local branch called 'jh' that tracks remote head jh/mtree:
/usr/src/orig/sip-router$ git checkout --track -b jh remotes/origin/jh/mtree Branch jh set up to track remote branch jh/mtree from origin. Switched to a new branch 'jh'
then i do pull:
/usr/src/orig/sip-router$ eg pull jh@git.sip-router.org's password: Already up-to-date.
and after that lib/srdb1/schema/entities.xml does not contain the change that i did to master this morning.
From the above commands, I don't see why it should. Local branch jh tracks origin/jh/mtree, not master. So why would a master change suddenly appear in the jh branch? I would expect changes you push to origin/jh/mtree to appear in your local jh branch after a pull, nothing else.
disclaimer: I always use EasyGit, but i expect these fundamentals to be the same in bare git and EasyGit mentions no differences on this subject.
Alex Hermann writes:
Is local mtree branch supposed to track master?
...
From the above commands, I don't see why it should. Local branch jh tracks origin/jh/mtree, not master. So why would a master change suddenly appear in the jh branch? I would expect changes you push to origin/jh/mtree to appear in your local jh branch after a pull, nothing else.
if jh/mtree tracks master (as it according to the wiki page is supposed to do) and when jh tracks remote branch jh/mtree, then according to normal logic it follows that also jh tracks master.
-- juha
On Thursday 08 September 2011, Juha Heinanen wrote:
Alex Hermann writes:
Is local mtree branch supposed to track master?
...
From the above commands, I don't see why it should. Local branch jh tracks origin/jh/mtree, not master. So why would a master change suddenly appear in the jh branch? I would expect changes you push to origin/jh/mtree to appear in your local jh branch after a pull, nothing else.
if jh/mtree tracks master (as it according to the wiki page is supposed to do) and when jh tracks remote branch jh/mtree, then according to normal logic it follows that also jh tracks master.
It does, but requires a bit more work. Git doesn't do recursive pull's (automatically).
You'd first have to pull master in jh/mtree, push that out to origin, and then pull that into local jh.
The --track option really doesn't do anything more than setting a default, it does not imply automatic behavior in any way.
Alex Hermann writes:
You'd first have to pull master in jh/mtree, push that out to origin, and then pull that into local jh.
alex,
what would that mean in terms of eg or git commands?
in 'jh', i tried 'eg pull --branch master', but it failed miserably:
$ eg pull --branch master jh@git.sip-router.org's password:
From ssh://git.sip-router.org/sip-router
* branch master -> FETCH_HEAD CONFLICT (directory/file): There is a directory with name pkg/kamailio/gentoo in HEAD. Adding pkg/kamailio/gentoo as pkg/kamailio/gentoo~5ecd7deddc7a6fb23f8d0bb530be3e68672c495d Removing pkg/kamailio/gentoo/kamailio-1.2.0.ebuild Removing pkg/kamailio/gentoo/kamailio.init Removing pkg/ser/gentoo/ser-0.8.10.ebuild Removing pkg/ser/gentoo/ser-0.8.11.ebuild Removing pkg/ser/gentoo/ser-0.8.12.ebuild Removing pkg/ser/gentoo/ser-0.8.14.ebuild Removing pkg/ser/gentoo/ser-0.8.9.ebuild Removing pkg/ser/gentoo/ser.init Automatic merge failed; fix conflicts and then commit the result.
-- juha
On Thursday 08 September 2011, Juha Heinanen wrote:
Alex Hermann writes:
You'd first have to pull master in jh/mtree, push that out to origin, and then pull that into local jh.
alex,
what would that mean in terms of eg or git commands?
I think something like this: with jh/mtree tracking master (local) and jh tracking origin/jh/mtree (remote)
eg switch jh/mtree eg pull --branch master eg push eg switch jh eg pull
in 'jh', i tried 'eg pull --branch master', but it failed miserably:
$ eg pull --branch master
Automatic merge failed; fix conflicts and then commit the result.
I think this is doing the right thing, but stumbles upon conflicting changes.
Alex Hermann writes:
I think something like this: with jh/mtree tracking master (local) and jh tracking origin/jh/mtree (remote)
eg switch jh/mtree eg pull --branch master eg push eg switch jh eg pull
eg does not like switching to jh/mtree, but suggest that a local branch is created that tracks jh/mtree. that is why i first did:
git checkout --track -b jh remotes/origin/jh/mtree Branch jh set up to track remote branch jh/mtree from origin. Switched to a new branch 'jh'
$ eg pull --branch master
Automatic merge failed; fix conflicts and then commit the result.
I think this is doing the right thing, but stumbles upon conflicting changes.
me too, but question is why there are conflicting changes? i have not pushed any changes to jh/mtree that would conflict with something done by others.
-- juha
is this conflict due to some git push done to master recently:
$ eg pull --branch master jh@git.sip-router.org's password:
From ssh://git.sip-router.org/sip-router
* branch master -> FETCH_HEAD CONFLICT (directory/file): There is a directory with name pkg/kamailio/gentoo in HEAD. Adding pkg/kamailio/gentoo as pkg/kamailio/gentoo~5ecd7deddc7a6fb23f8d0bb530be3e68672c495d Removing pkg/kamailio/gentoo/kamailio-1.2.0.ebuild Removing pkg/kamailio/gentoo/kamailio.init Removing pkg/ser/gentoo/ser-0.8.10.ebuild Removing pkg/ser/gentoo/ser-0.8.11.ebuild Removing pkg/ser/gentoo/ser-0.8.12.ebuild Removing pkg/ser/gentoo/ser-0.8.14.ebuild Removing pkg/ser/gentoo/ser-0.8.9.ebuild Removing pkg/ser/gentoo/ser.init Automatic merge failed; fix conflicts and then commit the result.
if so, how to fix the conflict?
-- juha
Juha Heinanen writes:
is this conflict due to some git push done to master recently:
looks like the conflict is this:
$ eg log --merge commit a89e2b1a2f71c932f38c0bfdcceb2fa1880431f5 Author: Henning Westerholt henning.westerholt@1und1.de Date: Mon Sep 5 21:50:23 2011 +0200
pgk: add symlink to kamailio directory for new gentoo ebuild
commit d7b0e82c14caa1809bb6f0d96646354eabf2c253 Author: Henning Westerholt henning.westerholt@1und1.de Date: Mon Sep 5 18:17:40 2011 +0200
pkg: remove obselete gentoo ebuild, add new generic ebuild from Claudio Fur
henning, is there anything you can do about it?
-- juha
On Thursday 08 September 2011, Juha Heinanen wrote:
Juha Heinanen writes:
is this conflict due to some git push done to master recently:
looks like the conflict is this:
$ eg log --merge commit a89e2b1a2f71c932f38c0bfdcceb2fa1880431f5 [..] commit d7b0e82c14caa1809bb6f0d96646354eabf2c253 Author: Henning Westerholt henning.westerholt@1und1.de Date: Mon Sep 5 18:17:40 2011 +0200
henning, is there anything you can do about it?
Hi Juha,
I also saw this during my cherry-pick for the 3.1 branch, i don't know the reason. I not did something special, just a bunch of git rm and git mv commands, but maybe git has some difficulties with this?
There is a gui 'git mergetool', but its also possible to do this by hand with 'git rm' and 'git add'. If you run 'git status' it should show you the files/ directories in question. I guess in your case
'git rm pkg/kamailio/gentoo -r' should help to resolve the conflict.
Best regards,
Henning
On Thursday 08 September 2011, Juha Heinanen wrote:
Henning Westerholt writes:
'git rm pkg/kamailio/gentoo -r' should help to resolve the conflict.
henning,
that removed the conflict, although i don't understand how the conflict was possible in the first place, because i have never touched that directory in any branch.
Hi Juha,
yes, its strange. Not sure if had some local changes in the 3.1 tree and therefore git was not able to remove that directory completely, but this still would not explain your problem.
Best regards,
Henning
On 08.09.2011 10:16, Juha Heinanen wrote:
a week ago i created a new head jh/mtree, which is supposed to track master:
git checkout --track -b mtree master git push origin mtree:jh/mtree
now when i browse that head on gitweb page, i don't see any changes done to master, such as the one i did today on lib/srdb1/schema/entities.xml.
Do you possibly need -u (--set-upstream) when pushing your branch to the repo?
http://stackoverflow.com/questions/520650/how-do-you-make-an-existing-git-br...
HTH,
--Timo
Timo Reimann writes:
Do you possibly need -u (--set-upstream) when pushing your branch to the repo?
i don't know about that. when i created jh/mtree, i followed instructions on sr wiki page:
http://sip-router.org/wiki/git/crash-course
if those instructions are invalid, i would appreciate if someone familiar with git would fix them.
-- juha