{"thread":{"id":"6877","subject":"Publishing Question: First time Pushing to nonexsiting directory","startedAt":"2007-02-19T07:35:26Z","lastAt":"2007-02-19T20:10:12Z","messageCount":6,"participants":["Thomas Glanzmann","Shawn O. Pearce","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34981","messageId":"20070219073526.GA26531@cip.informatik.uni-erlangen.de","threadId":"6877","inReplyTo":null,"subject":"Publishing Question: First time Pushing to nonexsiting directory","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-02-19T07:35:26Z","receivedAt":"2007-02-19T07:35:26Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello,\nI thought that there is a command available which I can use to push a\nrepository to a remote nonexisting location (that gets created on the\nfly) like in the following scenario:\n\n        - Create a git project on my laptop\n        - Check in a few files\n        - Publish the git repository to \n\n        (thinkpad) [~/work/astro-tg] git push 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro/\n        fatal: '/home/cip/adm/sithglan/work/repositories/private/astro': unable to chdir or not a git archive\n        fatal: The remote end hung up unexpectedly\n\nI thought that I read a comment from Linus(?) long time ago to how to obtain\nthat. But I am unable to find the e-mail in my archives. If there is no\nstandard way, how do you do it? Just rsync the files and change the\n'origin'?\n\n        Thomas\n"},{"id":"34983","messageId":"20070219081010.GC30030@spearce.org","threadId":"6877","inReplyTo":"20070219073526.GA26531@cip.informatik.uni-erlangen.de","subject":"Re: Publishing Question: First time Pushing to nonexsiting directory","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-19T08:10:10Z","receivedAt":"2007-02-19T08:10:10Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Thomas Glanzmann <thomas@glanzmann.de> wrote:\n> I thought that there is a command available which I can use to push a\n> repository to a remote nonexisting location (that gets created on the\n> fly) like in the following scenario:\n> \n>         - Create a git project on my laptop\n>         - Check in a few files\n>         - Publish the git repository to \n> \n>         (thinkpad) [~/work/astro-tg] git push 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro/\n>         fatal: '/home/cip/adm/sithglan/work/repositories/private/astro': unable to chdir or not a git archive\n>         fatal: The remote end hung up unexpectedly\n> \n> I thought that I read a comment from Linus(?) long time ago to how to obtain\n> that. But I am unable to find the e-mail in my archives. If there is no\n> standard way, how do you do it? Just rsync the files and change the\n> 'origin'?\n\nSSH into the remote system that you want to push to, then run\ninit-db there:\n\n  $ ssh 131.188.30.59 git --git-dir=/home/cip/adm/sithglan/work/repositories/private/astro.git init-db\n\nConfigure that as a remote, e.g. origin:\n\n  $ git remote add origin 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro.git\n\nNow push to there:\n\n  $ git push origin master:master\n\nAnd maybe fetch back to create the tracking branches:\n\n  $ git fetch\n\n\nNote that in my examples above I added \".git\" to the end of the\nrepository path, as this is rather typical for a 'bare repository'\n(that is, a repository without a working directory attached).\nYou usually don't want to push into a repository with a working\ndirectory, but it is supported and a lot of folks do it.\n\nI also assumed Git 1.5.0 on your thinkpad end, as git-remote was\nrecently added in that version.  Handy tool.  :)\n\n-- \nShawn.\n"},{"id":"34985","messageId":"7vk5yea6nh.fsf@assigned-by-dhcp.cox.net","threadId":"6877","inReplyTo":"20070219073526.GA26531@cip.informatik.uni-erlangen.de","subject":"Re: Publishing Question: First time Pushing to nonexsiting directory","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-19T08:33:22Z","receivedAt":"2007-02-19T08:33:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Glanzmann <thomas@glanzmann.de> writes:\n\n> I thought that there is a command available which I can use to push a\n> repository to a remote nonexisting location (that gets created on the\n> fly) ...\n\nSorry, there isn't.\n\n> I thought that I read a comment from Linus(?) long time ago to how to obtain\n> that. But I am unable to find the e-mail in my archives. If there is no\n> standard way, how do you do it? Just rsync the files and change the\n> 'origin'?\n\nWhat you remember might be this one:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/31351/focus=31610\n\nEven if it isn't, it is worth a read.  Look for \"The creation of\na new archive tends to\" and \"really _has_ to be separate\".\n\nThere was another discussion around this topic as well:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/32040/focus=32108\n\nwhich I think is a possible design in the right direction, but I\ndid not hear much from the users (as you can see in the archive\nlink above) so it hasn't materialized.  The only real improvement\nthat came out of the thread is deletion of a branch at the remote\nsite with \"git-push :refs/heads/to-be-removed\".\n\nAnother ancient one is:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/12651/focus=12667\n"},{"id":"35020","messageId":"20070219194423.GJ786@cip.informatik.uni-erlangen.de","threadId":"6877","inReplyTo":"20070219081010.GC30030@spearce.org","subject":"Re: Publishing Question: First time Pushing to nonexsiting directory","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-02-19T19:44:23Z","receivedAt":"2007-02-19T19:44:23Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hallo Shawn,\n\n>   $ ssh 131.188.30.59 git --git-dir=/home/cip/adm/sithglan/work/repositories/private/astro.git init-db\n>   $ git remote add origin 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro.git\n>   $ git push origin master:master\n>   $ git fetch\n\nthank you a lot. I just got home where I have internet connectivity with\nmy laptop and tried your tips. That was by the way exactly I was looking\nfor. Thank you a lot. However, I got a little problem. Here is the output:\n\n        (thinkpad) [~/work/astro] ssh 131.188.30.59 git --git-dir=/home/cip/adm/sithglan/work/repositories/private/astro.git init-db\n        (thinkpad) [~/work/astro] git remote add origin 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro.git\n        (thinkpad) [~/work/astro] git push origin master:master\n        updating 'refs/heads/master'\n        from 0000000000000000000000000000000000000000\n        to   7a04a7eb87797c4a5e8a6c4892d68862f202b2e2\n        Generating pack...\n        Done counting 30 objects.\n        Deltifying 30 objects.\n        100% (30/30) done\n        Writing 30 objects.\n        100% (30/30) done\n        Total 30 (delta 7), reused 0 (delta 0)\n        Unpacking 30 objects\n        refs/heads/master: 0000000000000000000000000000000000000000 -> 7a04a7eb87797c4a5e8a6c4892d68862f202b2e2\n        (thinkpad) [~/work/astro] git pull\n        * refs/remotes/origin/master: storing branch 'master' of 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro\n        commit: 7a04a7e\n        Warning: No merge candidate found because value of config option\n                \"branch.master.merge\" does not match any remote branch fetched.\n        No changes.\n        (thinkpad) [~/work/astro] git pull\n        Warning: No merge candidate found because value of config option\n                \"branch.master.merge\" does not match any remote branch fetched.\n        No changes.\n\nMaybe it is related to the fact that git version 1.4.4.4 is running on\nfaui00u (131.188.30.59).\n\n        Thomas\n"},{"id":"35021","messageId":"20070219200332.GA27565@spearce.org","threadId":"6877","inReplyTo":"20070219194423.GJ786@cip.informatik.uni-erlangen.de","subject":"Re: Publishing Question: First time Pushing to nonexsiting directory","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-19T20:03:32Z","receivedAt":"2007-02-19T20:03:32Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Thomas Glanzmann <thomas@glanzmann.de> wrote:\n>         (thinkpad) [~/work/astro] git pull\n>         * refs/remotes/origin/master: storing branch 'master' of 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro\n\nGood, the tracking branch was automatically created.\n\n>         commit: 7a04a7e\n>         Warning: No merge candidate found because value of config option\n>                 \"branch.master.merge\" does not match any remote branch fetched.\n\nCheck your .git/config.  There is no configuration describing what\nto do when `git pull` is invoked on your master branch.  You may want\nto add something like the following to your .git/config:\n\n\t[branch \"master\"]\n\t\tremote = origin\n\t\tmerge = refs/heads/master\n\nThis just says that by default, `git pull` will merge the master\nbranch of remote origin when you are on branch master.\n\n> Maybe it is related to the fact that git version 1.4.4.4 is running on\n> faui00u (131.188.30.59).\n\nNope.  It has to do with the fact that you are running 1.5.0 on your\nthinkpad and are missing the branch.master.merge entry noted above.\n\n-- \nShawn.\n"},{"id":"35025","messageId":"20070219201012.GL786@cip.informatik.uni-erlangen.de","threadId":"6877","inReplyTo":"20070219200332.GA27565@spearce.org","subject":"Re: Publishing Question: First time Pushing to nonexsiting directory","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-02-19T20:10:12Z","receivedAt":"2007-02-19T20:10:12Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello Shawn,\n\n> >         * refs/remotes/origin/master: storing branch 'master' of 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro\n> Good, the tracking branch was automatically created.\n\nI see.\n\n> This just says that by default, `git pull` will merge the master\n> branch of remote origin when you are on branch master.\n\nThanks. I added the lines and it doesn't give me the warning anylonger:\n\n        (thinkpad) [~/work/astro] git pull\n        Already up-to-date.\n\n> Nope.  It has to do with the fact that you are running 1.5.0 on your\n> thinkpad and are missing the branch.master.merge entry noted above.\n\nI see. Thanks for the awareness training.\n\n        Thomas\n"}]}