{"action":"closed","issue":{"url":"https://api.github.com/repos/sociomantic/git-hub/issues/127","labels_url":"https://api.github.com/repos/sociomantic/git-hub/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/sociomantic/git-hub/issues/127/comments","events_url":"https://api.github.com/repos/sociomantic/git-hub/issues/127/events","html_url":"https://github.com/sociomantic/git-hub/issues/127","id":66122904,"number":127,"title":"Provide option to name the fork of a repository when cloning","user":{"login":"andrej-mitrovic-sociomantic","id":7713325,"avatar_url":"https://avatars.githubusercontent.com/u/7713325?v=3","gravatar_id":"","url":"https://api.github.com/users/andrej-mitrovic-sociomantic","html_url":"https://github.com/andrej-mitrovic-sociomantic","followers_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/followers","following_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/orgs","repos_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/repos","events_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/andrej-mitrovic-sociomantic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sociomantic/git-hub/labels/difficulty-easy","name":"difficulty-easy","color":"eeeeee"},{"url":"https://api.github.com/repos/sociomantic/git-hub/labels/res-invalid","name":"res-invalid","color":"eeeeee"},{"url":"https://api.github.com/repos/sociomantic/git-hub/labels/type-enhancement","name":"type-enhancement","color":"ccffff"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/sociomantic/git-hub/milestones/12","html_url":"https://github.com/sociomantic/git-hub/milestones/v0.10","labels_url":"https://api.github.com/repos/sociomantic/git-hub/milestones/12/labels","id":1116072,"number":12,"title":"v0.10","description":"","creator":{"login":"leandro-lucarella-sociomantic","id":2684688,"avatar_url":"https://avatars.githubusercontent.com/u/2684688?v=3","gravatar_id":"","url":"https://api.github.com/users/leandro-lucarella-sociomantic","html_url":"https://github.com/leandro-lucarella-sociomantic","followers_url":"https://api.github.com/users/leandro-lucarella-sociomantic/followers","following_url":"https://api.github.com/users/leandro-lucarella-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/leandro-lucarella-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/leandro-lucarella-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leandro-lucarella-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/leandro-lucarella-sociomantic/orgs","repos_url":"https://api.github.com/users/leandro-lucarella-sociomantic/repos","events_url":"https://api.github.com/users/leandro-lucarella-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/leandro-lucarella-sociomantic/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":22,"state":"open","created_at":"2015-05-18T16:23:30Z","updated_at":"2015-12-17T19:53:35Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-04-03T10:30:05Z","updated_at":"2015-12-17T19:53:35Z","closed_at":"2015-12-17T19:53:35Z","body":"Currently `git-hub` has the `--remote` flag to name the `upstream` (the blessed) repo. But there's no equivalent to naming the user's fork of the repo, which defaults to `origin`.\r\n\r\nThe problem with the name `origin` is that inside of submodules `origin` is actually equivalent to the meaning of `upstream`. This makes it easy to create the mistake of pushing to `origin` while inside of a submodule, when we wanted to push to our fork instead. To visualize:\r\n\r\n```\r\n$ git hug clone sociomantic/repo\r\n$ cd repo\r\n$ git submodule update --init\r\n$ git remote -v\r\n\r\norigin\tgit@github.com:andrej-mitrovic-sociomantic/repo.git (fetch)\r\norigin\tgit@github.com:andrej-mitrovic-sociomantic/repo.git (push)\r\nupstream\tgit@github.com:sociomantic/repo.git (fetch)\r\nupstream\tgit@github.com:sociomantic/repo.git (push)\r\n\r\n$ cd submodules/repo2\r\n$ git remote -v\r\n\r\norigin\tgit@github.com:sociomantic/repo2.git (fetch)\r\norigin\tgit@github.com:sociomantic/repo2.git (push)\r\n```\r\n\r\nIf we had the option to name our fork during cloning, we could never make the mistake of pushing to the blessed repo. I'd make all my scripts or aliases always refer to my fork name (e.g. `drey` instead of `origin`), and a force push would never break a blessed repo this way."}}