{"thread":{"id":"11761","subject":"specific push default","startedAt":"2008-01-27T16:58:49Z","lastAt":"2008-01-27T16:58:49Z","messageCount":1,"participants":["Michael Dressel"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66682","messageId":"alpine.DEB.1.00.0801271751490.3323@pollux.milkiway.cos","threadId":"11761","inReplyTo":null,"subject":"specific push default","fromName":"Michael Dressel","fromEmail":"michaeltilodressel@t-online.de","sentAt":"2008-01-27T16:58:49Z","receivedAt":"2008-01-27T16:58:49Z","isPatch":false,"sender":{"key":"michaeltilodressel@t-online.de","avatar":null},"body":"Hi,\n\nthe model I  use git with has a central repository that is cloned by\ndevelopers and fetched and pushed into from developers. So the model is a\nbit CVS like.\n\nIn order to have git fetch, when used without arguments (default behavior),\nto fetch from all the branches in origin but to have git push, when used\nwithout arguments (default behavior), to push only the current branch I\nuse a specific configuration.\nFor illustration I have created simple stupid example repositories attached\nas zipped tar file to this e-mail. The example provides two sub directories.\nThe sub directory \"cr\" holds a bare git repository used to resemble a central\nrepository. The sub directory \"dr\" contains a git repository and a work tree\nresembling a developers repository.\n\nThere are two branches: master and green. When git push (no arguments) is\ninvoked from one of the branches only the current branch gets pushed into\nthe central repository (cr). On the other hand if there where updates in the\ncentral repository git fetch (no arguments) would fetch all branches.\nOf course merging would only be done in the current branch.\n\nThis is probably a very specific way of using git. It took me a while to set\nit up like that. Maybe that's just me. But maybe there is somebody else for\nwhom this e-mail could be of help.\n\nHere is the .git/config of the \"dr\" directory:\n[core]\n         repositoryformatversion = 0\n         filemode = true\n         bare = false\n         logallrefupdates = true\n[remote \"rmt_master\"]\n         url = ../cr\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         push = master\n[remote \"rmt_green\"]\n         url = ../cr\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         push = green\n[branch \"master\"]\n         remote = rmt_master\n         merge = refs/heads/master\n[branch \"green\"]\n         remote = rmt_green\n         merge = refs/heads/green\n\nHint:\nwhen e.g. \"git remote add rmt_green ../cr\" is used the remotes don't get\nsetup like that.A\n\"git config remote.rmt_green.fetch '+refs/heads/*:refs/remotes/origin/*'\"\nwould be required in advance.\n\n\nCheers,\nMichael\n\n"}]}