{"thread":{"id":"22033","subject":"Newbie to git","startedAt":"2009-12-27T16:12:46Z","lastAt":"2009-12-29T12:11:40Z","messageCount":12,"participants":["Jorge Bastos","mysql.jorge@decimal.pt","Howard Miller","Andreas Schwab","Junio C Hamano","Eugene Sajine","Shantanu Pavgi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130364","messageId":"1435.87.196.47.196.1261932152.squirrel@webmail.decimal.pt","threadId":"22033","inReplyTo":null,"subject":"Newbie to git","fromName":"Jorge Bastos","fromEmail":"mysql.jorge@decimal.pt","sentAt":null,"receivedAt":"2009-12-27T16:12:46Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"Howdy people,\n\nI'm a using of git for several time, but now I have the need to a git server.\nMy question, where can get a howto for reallyyyy newbies on git server?\n\nI have part of it setup but still not working.\n\nThanks in advanced,\nJorge,\n"},{"id":"130366","messageId":"3a9710ae6b01fabf3b462da607af2534@192.168.1.222","threadId":"22033","inReplyTo":"1435.87.196.47.196.1261932152.squirrel@webmail.decimal.pt","subject":"Re: Newbie to git","fromName":"","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-27T17:45:29Z","receivedAt":"2009-12-27T17:45:29Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"> I'm a using of git for several time, but now I have the need to a git\n> server.\n> My question, where can get a howto for reallyyyy newbies on git server?\n\nOne question:\n\nI've created a project on the server with:\n\nmkdir project.git\ncd project.git\ngit init\n\n-and now locally, created a directory, and cloned this, it said that i was\ncloning an empty repo, fine about that.\n-now i added something locally, i get: (locally this is on a windows\nmachine with tortoiso git)\n\n--\ngit.exe push  --tags  \"origin\" master:git://192.168.1.206/projects.git\n\nerror: src refspec master:git does not match any.\nerror: failed to push some refs to 'git://192.168.1.206/projects.git'\n--\n\nI've read somewhere that i have to init both repos, remote and local to\nthe same branch, is it correct?\n\nMy idea is:\n\n- clone remote repo\n- add projects locally and commit them to remote\n\nhow can this be done easylly?\n"},{"id":"130369","messageId":"26ae428a0912271212j70857e29m6248f6ec653f7551@mail.gmail.com","threadId":"22033","inReplyTo":"3a9710ae6b01fabf3b462da607af2534@192.168.1.222","subject":"Re: Newbie to git","fromName":"Howard Miller","fromEmail":"howardsmiller@googlemail.com","sentAt":"2009-12-27T20:12:09Z","receivedAt":"2009-12-27T20:12:09Z","isPatch":false,"sender":{"key":"howardsmiller@googlemail.com","avatar":"https://gravatar.com/avatar/69a7274bc5c4c66910b00e4ea6590e46e2325b53ff4807854f3ed469b49400b1?d=mp&s=160"},"body":"2009/12/27  <mysql.jorge@decimal.pt>:\n>> I'm a using of git for several time, but now I have the need to a git\n>> server.\n>> My question, where can get a howto for reallyyyy newbies on git server?\n>\n> One question:\n>\n> I've created a project on the server with:\n>\n> mkdir project.git\n> cd project.git\n> git init\n>\n> -and now locally, created a directory, and cloned this, it said that i was\n> cloning an empty repo, fine about that.\n> -now i added something locally, i get: (locally this is on a windows\n> machine with tortoiso git)\n>\n> --\n> git.exe push  --tags  \"origin\" master:git://192.168.1.206/projects.git\n>\n> error: src refspec master:git does not match any.\n> error: failed to push some refs to 'git://192.168.1.206/projects.git'\n\nFirstly, I would have a serious look at 'gitosis' for the server end\n(there are other similar projects I believe).\n\nSecondly, the push command is wrong. You don't need to supply the\nremote URL again... that's what 'origin' is telling the push command,\nwhich remote to use. This would have been established by the original\nclone.\n\nAlso, again, be careful with 'empty' repositories. (again AFAIK) an\nempty repository is just that, it doesn't even have a master branch so\nyou really need to check out a branch and commit something before\npushing makes much sense. I'm sure this is not 100% correct but you'll\nbe safe that way!\n\nHoward\n"},{"id":"130374","messageId":"0a78ff1d3ae5d236fa45c31f7bb8bd54@192.168.1.222","threadId":"22033","inReplyTo":"26ae428a0912271212j70857e29m6248f6ec653f7551@mail.gmail.com","subject":"Re: Newbie to git","fromName":"","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-27T21:55:46Z","receivedAt":"2009-12-27T21:55:46Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"Hi Howard,\n\n> Firstly, I would have a serious look at 'gitosis' for the server end\n> (there are other similar projects I believe).\n> \n> Secondly, the push command is wrong. You don't need to supply the\n> remote URL again... that's what 'origin' is telling the push command,\n> which remote to use. This would have been established by the original\n> clone.\n> \n> Also, again, be careful with 'empty' repositories. (again AFAIK) an\n> empty repository is just that, it doesn't even have a master branch so\n> you really need to check out a branch and commit something before\n> pushing makes much sense. I'm sure this is not 100% correct but you'll\n> be safe that way!\n\nWell, gitosis even made me more confused :P\n\nLet me reask:\nI'm running git deamon under supervisor with:\n\n/usr/lib/git-core/git-daemon --syslog --export-all --enable=receive-pack\n--verbose --base-path=/home/apache/gitprojects\n\nthen i went to /home/apache/gitprojects and runned:\n\ngit init\ngit add .\n\nbut for example, CGIT web interface says:\n\n--\nNot a git repository: '/home/apache/gitprojects'\ngenerated by cgit at 2009-12-27 21:54:47 (GMT)\n--\n\nwhat could i be missing here?\nI've been reading howto's i find on the web, but all lead me to the same\npoint, what i did and non work.. (with me).\n\nJorge,\n"},{"id":"130376","messageId":"m27hs8t5b7.fsf@whitebox.home","threadId":"22033","inReplyTo":"0a78ff1d3ae5d236fa45c31f7bb8bd54@192.168.1.222","subject":"Re: Newbie to git","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2009-12-27T22:34:04Z","receivedAt":"2009-12-27T22:34:04Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"<mysql.jorge@decimal.pt> writes:\n\n> then i went to /home/apache/gitprojects and runned:\n>\n> git init\n\nYou probably want to create a bare repository in this directory:\n\n$ git init --bare foo.git\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"130377","messageId":"ecddd9ed719d3d854b2248970cdb9cdf@192.168.1.222","threadId":"22033","inReplyTo":"m27hs8t5b7.fsf@whitebox.home","subject":"Re: Newbie to git","fromName":"","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-27T23:00:04Z","receivedAt":"2009-12-27T23:00:04Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"Hi Andreas,\n\n> You probably want to create a bare repository in this directory:\n> \n> $ git init --bare foo.git\n> \n\nOk one more point, seams to be that!\nForgive my really newbie question:\n\nnot i have:\n/home/apache/gitprojects/mydir.git\n\ncreated with: git init --base mydir.git\n\nNow, inside here, what should i do to create my projects:\n\nmkdir myproject1\ncd myproject1\ngit init\ntouch a.txt\ngit add .\ngit commit -m \"1st commit\"\n\n\nam i correct or not really?\n"},{"id":"130379","messageId":"7v8wcnx2lq.fsf@alter.siamese.dyndns.org","threadId":"22033","inReplyTo":"ecddd9ed719d3d854b2248970cdb9cdf@192.168.1.222","subject":"Re: Newbie to git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-28T02:18:57Z","receivedAt":"2009-12-28T02:18:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<mysql.jorge@decimal.pt> writes:\n\n> Hi Andreas,\n\nIf you are addressing Andreas, why does your mail have:\n\n    To: <git@vger.kernel.org>\n    Cc: <git@vger.kernel.org>\n\nand no other addressee???\n\n> not i have:\n> /home/apache/gitprojects/mydir.git\n>\n> created with: git init --base mydir.git\n>\n> Now, inside here, what should i do to create my projects:\n>\n> mkdir myproject1\n> cd myproject1\n> git init\n> touch a.txt\n> git add .\n> git commit -m \"1st commit\"\n>\n> am i correct or not really?\n\nYou created \"myproject1\" somewhere you started \"mkdir\" in (perhaps in\n$HOME?) [*1*] and that project tracks a single file \"a.txt\"; you are\ncorrect if that was what you wanted to do.\n\nThe new repository \"myproject1\" doesn't have any relation to the bare\nrepository at /home/apache/gitprojects/mydir.git/ you created earlier.\nThe next steps I recommend new people are:\n\n (1) push into the public repository, by doing:\n\n     cd myproject1\n     git push /home/apache/gitprojects/mydir.git/ master\n\n (2) make sure push went correctly by trying to clone from there:\n\n     cd ..\n     mv myproject1 myproject1.old\n     git clone /home/apache/gitprojects/mydir.git/ myproject1\n\n (3) check if the clone is what you expect\n\n     diff myproject1.old/a.txt myproject1/a.txt\n\n (4) once satisfied, remove the old one\n\n     rm -fr myproject1.old\n\nAnd keep working in the myproject1 repository from there on.\n\n\n[Footnote]\n\n*1* If you started that \"mkdir\" somewhere else you may want to remove it\nand redo that step, especially if you did so inside that bare repository\nyou created earlier, i.e. /home/apache/gitprojects/mydir.git directory.\nYou don't want to have it there.\n"},{"id":"130392","messageId":"7a0ae9cb57a1bc55653872ab254ea922@192.168.1.222","threadId":"22033","inReplyTo":"7v8wcnx2lq.fsf@alter.siamese.dyndns.org","subject":"Re: Newbie to git","fromName":"","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-28T10:34:57Z","receivedAt":"2009-12-28T10:34:57Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"> If you are addressing Andreas, why does your mail have:\n> \n>     To: <git@vger.kernel.org>\n>     Cc: <git@vger.kernel.org>\n> \n> and no other addressee???\n\nMy error, sorry :)\n\n> You created \"myproject1\" somewhere you started \"mkdir\" in (perhaps in\n> $HOME?) [*1*] and that project tracks a single file \"a.txt\"; you are\n> correct if that was what you wanted to do.\n> \n> The new repository \"myproject1\" doesn't have any relation to the bare\n> repository at /home/apache/gitprojects/mydir.git/ you created earlier.\n> The next steps I recommend new people are:\n> \n>  (1) push into the public repository, by doing:\n> \n>      cd myproject1\n>      git push /home/apache/gitprojects/mydir.git/ master\n> \n>  (2) make sure push went correctly by trying to clone from there:\n> \n>      cd ..\n>      mv myproject1 myproject1.old\n>      git clone /home/apache/gitprojects/mydir.git/ myproject1\n> \n>  (3) check if the clone is what you expect\n> \n>      diff myproject1.old/a.txt myproject1/a.txt\n> \n>  (4) once satisfied, remove the old one\n> \n>      rm -fr myproject1.old\n> \n> And keep working in the myproject1 repository from there on.\n\nThank you, i understood, i believe i really did. did that test and it's\nOK.\nBut let me reask in another way:\n\nI want to setup the git server, to accept new branch's created in a remote\nplace that will be push'ed to it, please correct me, 'cause i'm doing\nsomething wrong and i don't know what yet.\n\n- setup git server to run with:\n/usr/lib/git-core/git-daemon --reuseaddr --syslog --export-all\n--enable=receive-pack --verbose --base-path=/home/apache/gitprojects\n\n- created directory /home/apache/gitprojects\n- git init --bare /home/apache/gitprojects\n\n- what will be my link on the remote? \"git://192.168.1.206\" just?\n- From now on, how can I have access to push projects that exist on other\nmachine?\n\nSorry for the questions... they are newbie!\nJorge,\n"},{"id":"130403","messageId":"76c5b8580912280851k141bc6cev36df72b1993b8359@mail.gmail.com","threadId":"22033","inReplyTo":"7a0ae9cb57a1bc55653872ab254ea922@192.168.1.222","subject":"Re: Newbie to git","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2009-12-28T16:51:54Z","receivedAt":"2009-12-28T16:51:54Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Mon, Dec 28, 2009 at 5:34 AM,  <mysql.jorge@decimal.pt> wrote:\n>> If you are addressing Andreas, why does your mail have:\n>>\n>>     To: <git@vger.kernel.org>\n>>     Cc: <git@vger.kernel.org>\n>>\n>> and no other addressee???\n>\n> My error, sorry :)\n>\n>> You created \"myproject1\" somewhere you started \"mkdir\" in (perhaps in\n>> $HOME?) [*1*] and that project tracks a single file \"a.txt\"; you are\n>> correct if that was what you wanted to do.\n>>\n>> The new repository \"myproject1\" doesn't have any relation to the bare\n>> repository at /home/apache/gitprojects/mydir.git/ you created earlier.\n>> The next steps I recommend new people are:\n>>\n>>  (1) push into the public repository, by doing:\n>>\n>>      cd myproject1\n>>      git push /home/apache/gitprojects/mydir.git/ master\n>>\n>>  (2) make sure push went correctly by trying to clone from there:\n>>\n>>      cd ..\n>>      mv myproject1 myproject1.old\n>>      git clone /home/apache/gitprojects/mydir.git/ myproject1\n>>\n>>  (3) check if the clone is what you expect\n>>\n>>      diff myproject1.old/a.txt myproject1/a.txt\n>>\n>>  (4) once satisfied, remove the old one\n>>\n>>      rm -fr myproject1.old\n>>\n>> And keep working in the myproject1 repository from there on.\n>\n> Thank you, i understood, i believe i really did. did that test and it's\n> OK.\n> But let me reask in another way:\n>\n> I want to setup the git server, to accept new branch's created in a remote\n> place that will be push'ed to it, please correct me, 'cause i'm doing\n> something wrong and i don't know what yet.\n>\n> - setup git server to run with:\n> /usr/lib/git-core/git-daemon --reuseaddr --syslog --export-all\n> --enable=receive-pack --verbose --base-path=/home/apache/gitprojects\n>\n> - created directory /home/apache/gitprojects\n> - git init --bare /home/apache/gitprojects\n>\n> - what will be my link on the remote? \"git://192.168.1.206\" just?\n> - From now on, how can I have access to push projects that exist on other\n> machine?\n>\n> Sorry for the questions... they are newbie!\n> Jorge,\n\n\nYour /home/apache/gitprojects is a folder where your git repositories\nare supposed to be placed.\nYour Git repository = your project.\n\nBy running a git daemon the way you do - you say that you are going to\nserve all repositories from /home/apache/gitprojects.\n\nBare repo = repo without working copy - the one which contains only\nhistory and git objects (imagine it to be only .git folder from normal\nrepo) Therefore for bare repos there is a naming convention so they\nhave .git extension, while normal repo doesn't. So, myProject.git is\nserver based bare repo, while myProject is a local repo.\n\nFinally you have /home/apache/gitprojects/myProject.git\n\nThe URL to clone from there will be - should be shown to you by CGIT\nif you have everything correctly set up\ngit://192.168.1.206/myProject.git\n\nHope that helps,\nEugene\n"},{"id":"130427","messageId":"4e972734347b7ad47786807a7abe1c0e@192.168.1.222","threadId":"22033","inReplyTo":"76c5b8580912280851k141bc6cev36df72b1993b8359@mail.gmail.com","subject":"Re: Newbie to git","fromName":"Jorge Bastos","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-28T22:23:52Z","receivedAt":"2009-12-28T22:23:52Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"> Your /home/apache/gitprojects is a folder where your git repositories\n> are supposed to be placed.\n> Your Git repository = your project.\n> \n> By running a git daemon the way you do - you say that you are going to\n> serve all repositories from /home/apache/gitprojects.\n> \n> Bare repo = repo without working copy - the one which contains only\n> history and git objects (imagine it to be only .git folder from normal\n> repo) Therefore for bare repos there is a naming convention so they\n> have .git extension, while normal repo doesn't. So, myProject.git is\n> server based bare repo, while myProject is a local repo.\n> \n> Finally you have /home/apache/gitprojects/myProject.git\n> \n> The URL to clone from there will be - should be shown to you by CGIT\n> if you have everything correctly set up\n> git://192.168.1.206/myProject.git\n\nLets see if i understood:\n\nmy steps:\n\ngit init --bare /home/apache/gitbare\ncd /home/apache/gitprojects\nmkdir project\ncd project\ngit init myproject.git\n\non gitweb, i see the project names in this format:\n\"myproject.git/.git\"\n\nfor example, for the git repo on git.kernel.org, it is shown as:\n\"git/git.git\"\n\nshouldn't it appear in the same way here?\n\ni have:\n$projectroot = \"/home/apache/gitprojects/project/\";\n\nfor CGIT, i have:\nrepo.path=/home/apache/gitprojects/project/myproject.git\n\nbut it doesn't show nothing after i click it.\n\n\non the other hand, i cannot push changes via remote, after cloned the\nrepository with:\n\n\ngit clone git://192.168.1.206/project/myproject.git\n\nadd some files\n\ngit add .\ngit commit -m \"aaaa\"\ngit push --tags \"origin\" master:master\n\n\nand get:\n\nerror: unpack failed: unpack-objects abnormal exit\nTo git://192.168.1.206/project/myproject.git\n ! [remote rejected] master -> master (n/a (unpacker error))\nerror: failed to push some refs to\n'git://192.168.1.206/project/myproject.git'\nFailed\n\n\ni feel i'm almost there but something is missing here... sorry my\nnewbienest!\n"},{"id":"130431","messageId":"540FAB030B18B14B8E672DB4B500635B1769FFD879@UABEXMBS6.ad.uab.edu","threadId":"22033","inReplyTo":"4e972734347b7ad47786807a7abe1c0e@192.168.1.222","subject":"RE: Newbie to git","fromName":"Shantanu Pavgi","fromEmail":"pavgi@uab.edu","sentAt":"2009-12-28T23:51:50Z","receivedAt":"2009-12-28T23:51:50Z","isPatch":false,"sender":{"key":"pavgi@uab.edu","avatar":null},"body":"Jorge,\n\nI remember having similar problem. I think it is with the user permissions. Check if the 'push-user' has read-write permissions on public repo. Check out  '--shared' option while initializing bare repo  (git-init --bare) or set appropriate permissions using chown/chmod. Hope this helps..\n\nThanks,\nShantanu Pavgi.\n\n\n\n________________________________________\nFrom: git-owner@vger.kernel.org [git-owner@vger.kernel.org] On Behalf Of Jorge Bastos [mysql.jorge@decimal.pt]\nSent: Monday, December 28, 2009 4:23 PM\nTo: Eugene Sajine\nCc: Junio C Hamano; git@vger.kernel.org\nSubject: Re: Newbie to git\n\n> Your /home/apache/gitprojects is a folder where your git repositories\n> are supposed to be placed.\n> Your Git repository = your project.\n>\n> By running a git daemon the way you do - you say that you are going to\n> serve all repositories from /home/apache/gitprojects.\n>\n> Bare repo = repo without working copy - the one which contains only\n> history and git objects (imagine it to be only .git folder from normal\n> repo) Therefore for bare repos there is a naming convention so they\n> have .git extension, while normal repo doesn't. So, myProject.git is\n> server based bare repo, while myProject is a local repo.\n>\n> Finally you have /home/apache/gitprojects/myProject.git\n>\n> The URL to clone from there will be - should be shown to you by CGIT\n> if you have everything correctly set up\n> git://192.168.1.206/myProject.git\n\nLets see if i understood:\n\nmy steps:\n\ngit init --bare /home/apache/gitbare\ncd /home/apache/gitprojects\nmkdir project\ncd project\ngit init myproject.git\n\non gitweb, i see the project names in this format:\n\"myproject.git/.git\"\n\nfor example, for the git repo on git.kernel.org, it is shown as:\n\"git/git.git\"\n\nshouldn't it appear in the same way here?\n\ni have:\n$projectroot = \"/home/apache/gitprojects/project/\";\n\nfor CGIT, i have:\nrepo.path=/home/apache/gitprojects/project/myproject.git\n\nbut it doesn't show nothing after i click it.\n\n\non the other hand, i cannot push changes via remote, after cloned the\nrepository with:\n\n\ngit clone git://192.168.1.206/project/myproject.git\n\nadd some files\n\ngit add .\ngit commit -m \"aaaa\"\ngit push --tags \"origin\" master:master\n\n\nand get:\n\nerror: unpack failed: unpack-objects abnormal exit\nTo git://192.168.1.206/project/myproject.git\n ! [remote rejected] master -> master (n/a (unpacker error))\nerror: failed to push some refs to\n'git://192.168.1.206/project/myproject.git'\nFailed\n\n\ni feel i'm almost there but something is missing here... sorry my\nnewbienest!\n"},{"id":"130449","messageId":"d1d7541ccb528f0345ad2bf15faa8570@192.168.1.222","threadId":"22033","inReplyTo":"540FAB030B18B14B8E672DB4B500635B1769FFD879@UABEXMBS6.ad.uab.edu","subject":"RE: Newbie to git","fromName":"Jorge Bastos","fromEmail":"mysql.jorge@decimal.pt","sentAt":"2009-12-29T12:11:40Z","receivedAt":"2009-12-29T12:11:40Z","isPatch":false,"sender":{"key":"mysql.jorge@decimal.pt","avatar":null},"body":"> I remember having similar problem. I think it is with the user\n> permissions. Check if the 'push-user' has read-write permissions on\npublic\n> repo. Check out  '--shared' option while initializing bare repo \n(git-init\n> --bare) or set appropriate permissions using chown/chmod. Hope this\nhelps..\n\nBingo!\n\nThank you,\nJorge,\n"}]}