{"action":"created","issue":{"url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/16","labels_url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/16/comments","events_url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/16/events","html_url":"https://github.com/OSMBrasil/OSMBrasil.github.io/issues/16","id":82962898,"number":16,"title":"Backup ou proteção contra git -f push","user":{"login":"alexandre-mbm","id":957501,"avatar_url":"https://avatars.githubusercontent.com/u/957501?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandre-mbm","html_url":"https://github.com/alexandre-mbm","followers_url":"https://api.github.com/users/alexandre-mbm/followers","following_url":"https://api.github.com/users/alexandre-mbm/following{/other_user}","gists_url":"https://api.github.com/users/alexandre-mbm/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandre-mbm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandre-mbm/subscriptions","organizations_url":"https://api.github.com/users/alexandre-mbm/orgs","repos_url":"https://api.github.com/users/alexandre-mbm/repos","events_url":"https://api.github.com/users/alexandre-mbm/events{/privacy}","received_events_url":"https://api.github.com/users/alexandre-mbm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/labels/for%20after","name":"for after","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-31T01:17:20Z","updated_at":"2015-06-02T21:16:45Z","closed_at":null,"body":"Seguem os resultados de uma pesquisa no Google.\r\n\r\nPodemos estudar o uso de _hooks_:\r\n- [stefansundin / install-pre-push.sh](https://gist.github.com/stefansundin/d465f1e331fc5c632088)\r\n- [Do not allow force push to master](http://blog.bigbinary.com/2013/09/19/do-not-allow-force-pusht-to-master.html) ‒ BIGbinary\r\n  - **[tiny_scripts/git-hooks/hooks/pre-push](https://github.com/bigbinary/tiny_scripts/blob/master/git-hooks/hooks/pre-push)** ‒ Ruby\r\n- [Git: Disable Force Push](https://coderwall.com/p/wo3kng/git-disable-force-push)\r\n  - `git config --system receive.denyNonFastForwards true`\r\n  - [pixelhandler / pre-push.sh](https://gist.github.com/pixelhandler/5718585)\r\n- [GIT Hack: Prevent pushing to master](http://dev.ghost.org/prevent-master-push/)\r\n  - **Oops!** _\"Many projects use GitHub as their remote repository, and as GitHub is a service, they do not permit you to upload arbitrary scripts to run on their servers.\"_\r\n\r\n---\r\n\r\nSe fosse GitHub Enterprise...\r\n- Blocking force pushes to a repository\r\n  - [11.10.340](https://help.github.com/enterprise/11.10.340/admin/articles/blocking-force-pushes-to-a-repository/)\r\n  - [2.1](https://help.github.com/enterprise/2.1/admin/articles/blocking-force-pushes-to-a-repository/)\r\n  - [2.2](https://help.github.com/enterprise/2.2/admin/articles/blocking-force-pushes-to-a-repository/)\r\n\r\nMas como não é:\r\n- **[Elegant solution to prevent force push on master only](http://stackoverflow.com/a/24436947/3391915)**\r\n- [GitHub - prevent collaborators from using push -f](http://stackoverflow.com/a/5094762/3391915)\r\n\r\nE se fosse GitLab...\r\n- [Keeping your code protected](https://about.gitlab.com/2014/11/26/keeping-your-code-protected/)\r\n\r\n---\r\n\r\n@naoliv já configurou [BackHub](https://backhub.co/). Uma ideia seria, para além disso, ter um _hook_ fazendo backup em branch automaticamente nomeado e empurrado para o GitHub. Ou ao menos avisando dos perigos. Que eu saiba, os _hooks_ são compartilhados com todas as pessoas que fazem _pull_ do código."},"comment":{"url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/comments/108101386","html_url":"https://github.com/OSMBrasil/OSMBrasil.github.io/issues/16#issuecomment-108101386","issue_url":"https://api.github.com/repos/OSMBrasil/OSMBrasil.github.io/issues/16","id":108101386,"user":{"login":"naoliv","id":982338,"avatar_url":"https://avatars.githubusercontent.com/u/982338?v=3","gravatar_id":"","url":"https://api.github.com/users/naoliv","html_url":"https://github.com/naoliv","followers_url":"https://api.github.com/users/naoliv/followers","following_url":"https://api.github.com/users/naoliv/following{/other_user}","gists_url":"https://api.github.com/users/naoliv/gists{/gist_id}","starred_url":"https://api.github.com/users/naoliv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naoliv/subscriptions","organizations_url":"https://api.github.com/users/naoliv/orgs","repos_url":"https://api.github.com/users/naoliv/repos","events_url":"https://api.github.com/users/naoliv/events{/privacy}","received_events_url":"https://api.github.com/users/naoliv/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T21:16:45Z","updated_at":"2015-06-02T21:16:45Z","body":"Fui verificar agora e o https://backhub.co/ não serve\r\nSó armazena uma cópia (então se fizer backup bem depois de perder algo, não tem utilidade)"}}