{"thread":{"id":"21978","subject":"adding additional remote refs to a remote repo","startedAt":"2009-12-17T17:43:19Z","lastAt":"2009-12-17T18:19:01Z","messageCount":2,"participants":["Peter Petrakis","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130038","messageId":"a422b4da0912170943q2613faeao208eaa674d1a0afa@mail.gmail.com","threadId":"21978","inReplyTo":null,"subject":"adding additional remote refs to a remote repo","fromName":"Peter Petrakis","fromEmail":"peter.petrakis@gmail.com","sentAt":"2009-12-17T17:43:19Z","receivedAt":"2009-12-17T17:43:19Z","isPatch":false,"sender":{"key":"peter.petrakis@gmail.com","avatar":null},"body":"I'm setting up a remote repo to aggregate some development which spans\nmultiple git trees. So I have a bare repo setup using gitosis that I can happily\ncommit to. I've added the entries directly to the config on the server...\n\n-sh-3.2$ ls\nbranches  config  description  git-daemon-export-ok  HEAD  hooks  info\n objects  refs\n-sh-3.2$ cat config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = true\n[remote \"drbd-8.2\"]\n        url = git://git.drbd.org/drbd-8.2.git\n        fetch = +refs/heads/*:refs/remotes/drbd-8.2/*\n\n\nbut when I clone the repo, the remote doesn't show up.  What am I doing wrong?\nI can easily add the remotes in my local copy and work with the\nproduct. The problem\nis that we're tracking this upstream project and need to manage\nmultiple versions of\nit to serve past releases. So in my case the branches will directly\ntrack the upstream\ndevelopment + any changes we need and then be merged into master.\n\nFor example in my local clone.\n\n[remote \"drbd-8.2\"]\n        url = git://git.drbd.org/drbd-8.2.git\n        fetch = +refs/heads/*:refs/remotes/drbd-8.2/*\n[branch \"drbd-8.2.7-merge-branch\"]\n        remote = drbd-8.2\n        merge = refs/heads/master\n\nNow if I push this  drbd-8.2.7-merge-branch to the central repo, the\nnext guy won't\nknow for sure what this was tracking. I also don't want to have to\n'add remote ...'\nevery time I clone a new copy. Thanks.\n\nPeter\n"},{"id":"130039","messageId":"7v4onpo44q.fsf@alter.siamese.dyndns.org","threadId":"21978","inReplyTo":"a422b4da0912170943q2613faeao208eaa674d1a0afa@mail.gmail.com","subject":"Re: adding additional remote refs to a remote repo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-17T18:19:01Z","receivedAt":"2009-12-17T18:19:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Petrakis <peter.petrakis@gmail.com> writes:\n\n> Now if I push this drbd-8.2.7-merge-branch to the central repo, the next\n> guy won't know for sure what this was tracking. I also don't want to\n> have to 'add remote ...'  every time I clone a new copy. Thanks.\n\nThe kind of information you listed above are kept in $GIT_DIR/config of\neach repository.  This file is kept private to each repository, i.e. not\ncloned, fetched or pushed across repositories [*1*].\n\nThis is a deliberate design decision.\n\n - The file records mostly personal preferences, e.g. how user works with\n   his branches in the repository, if the integration is done via rebase\n   instead of merge, how the output is colored, etc.  Your colleagues can\n   and will use branches other than the ones that may be publicly shared\n   (like drbd-8.2.7-merge-branch), and how they use their private branches\n   is not something you want to dictate nor interfere with.\n\n - The [remote \"foo\"] sections and friends (e.g. [branch \"bar\"]) in the\n   \"$GIT_DIR/config\" in that bare repository you created specifies how\n   that particular repository interacts with the remote named \"foo\" and\n   how branch \"bar\" is integrated with other things.  These may not\n   necessarily match, and if you are using it as a middleman repository\n   between your developers and the project upstream, they will in general\n   not match, the setting the developer repositories want to use.  This\n   should be obvious if you think about where remote.origin.url should\n   point at.  In the middleman repository, you would want \"git fetch\"\n   without \"origin\" to slurp from the upstream and in the developer clones\n   of this repository, you would want to \"git fetch\" to update from this\n   middleman repository.\n\n - The file can has pointers to external programs to be used as filters;\n   blindly copying it upon clone has security implications as well.\n\n\n[Footnote]\n\n*1* Often people use README-like document in-tree to tell developers about\nthe specific settings the project wants them to use (i.e. \"how to work\nwith this project\"), together with coding styles, submission guidelines,\netc., that are not tied to the use of git.\n"}]}