{"thread":{"id":"27655","subject":"help on importing","startedAt":"2011-06-19T15:03:48Z","lastAt":"2011-06-19T15:23:16Z","messageCount":2,"participants":["Mihamina Rakotomandimby","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"170231","messageId":"20110619180348.576ea06e.mihamina@bbs.mg","threadId":"27655","inReplyTo":null,"subject":"help on importing","fromName":"Mihamina Rakotomandimby","fromEmail":"mihamina@bbs.mg","sentAt":"2011-06-19T15:03:48Z","receivedAt":"2011-06-19T15:03:48Z","isPatch":false,"sender":{"key":"mihamina@bbs.mg","avatar":null},"body":"Hi all,\n\nI made several commits to a small local program.\nWhen I list them with \"git log\" I see them.\n\nTo publish my work, I choosed to sign in a forge (like github, google\ncode,...). I choosed forge.ocamlcore.org\n\nWith my account creation, the forge automatically created an empty GIT\nrepository.\n\nI clone it with:\n  git clone git+ssh://rakotomandimby@forge.ocamlcore.org/gitroot/ocaml-crypt/ocaml-crypt.git\n  Initialized empty Git repository in /tmp/ocaml-crypt/ocaml-crypt/.git/\n  warning: You appear to have cloned an empty repository.\nI am surprised the initialisation is not in /tmp/ocaml-crypt/ocaml-crypt.git/.git/ \nas I pulled \"ocaml-crypt.git\".\n\nAnyway...\nWhen add+commit a file into \"/tmp/ocaml-crypt/ocaml-crypt/\", \nI get no errors, but when pushing:\n  $ git push\n  No refs in common and none specified; doing nothing.\n  Perhaps you should specify a branch such as 'master'.\n  fatal: The remote end hung up unexpectedly\n\nI dont understand...\n\nIf I have success on this first simple steps, \nI could switch to the next level: Importing my local commits\nto that cloned repository ans then push that all.\n\nI read several GIT documentation, but it seems I dont have the \nright keywords to have good results...\n\n\nWould you help?\n\n-- \nRMA.\n"},{"id":"170253","messageId":"m3sjr5u9qg.fsf@localhost.localdomain","threadId":"27655","inReplyTo":"20110619180348.576ea06e.mihamina@bbs.mg","subject":"Re: help on importing","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-06-19T15:23:16Z","receivedAt":"2011-06-19T15:23:16Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mihamina Rakotomandimby <mihamina@bbs.mg> writes:\n\n> I made several commits to a small local program.\n> When I list them with \"git log\" I see them.\n> \n> To publish my work, I choosed to sign in a forge (like github, google\n> code,...). I choosed forge.ocamlcore.org\n\nNote that you don't have to choose _one_ place.  With distributed\nversion control systems you can interact with many remote repositories\n(though only one would be called \"origin\" and would be the default\nrepository).\n\nI for example push both to repo.or.cz and to GitHub.\n \n> With my account creation, the forge automatically created an empty GIT\n> repository.\n> \n> I clone it with:\n>\n>   $ git clone git+ssh://rakotomandimby@forge.ocamlcore.org/gitroot/ocaml-crypt/ocaml-crypt.git\n>   Initialized empty Git repository in /tmp/ocaml-crypt/ocaml-crypt/.git/\n>   warning: You appear to have cloned an empty repository.\n>\n> I am surprised the initialisation is not in /tmp/ocaml-crypt/ocaml-crypt.git/.git/ \n> as I pulled \"ocaml-crypt.git\".\n\nIt is Git convention to use 'project/.git' for a working repository,\nwhich working area (checked out files) in 'project/', while using\n'project.git' for name of _bare_ repository, i.e. without working\ndirectory.\n\n  project/.git  ==  project.git\n  project/          [no workdir]\n\n> Anyway...\n> When add+commit a file into \"/tmp/ocaml-crypt/ocaml-crypt/\", \n> I get no errors, but when pushing:\n>\n>   $ git push\n>   No refs in common and none specified; doing nothing.\n>   Perhaps you should specify a branch such as 'master'.\n>   fatal: The remote end hung up unexpectedly\n> \n> I don't understand...\n\nThe default Git behavior is to push *only* matching branches. With\nthis workflow you must push a branch explicitly first time. What you\nneed to do is to use\n\n  $ git push --all\n\nto push all branches, or \"git push origin HEAD\" to push only current\nbranch.\n\nThis behavior is configurable, either via `push.default` config\nvariable, or via `remote.origin.push`.\n\nHTH\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}