html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4218#issuecomment-657275143,https://api.github.com/repos/pydata/xarray/issues/4218,657275143,MDEyOklzc3VlQ29tbWVudDY1NzI3NTE0Mw==,14808389,2020-07-12T21:06:38Z,2020-07-12T21:07:33Z,MEMBER,"this was actually not that dangerous since everyone who synced the git history (i.e. at least @max-sixty) before that accident had a full ""backup"" of the commit history. Would it make sense to add a section for ""people with commit access"" to `contributing.rst`? I imagine this could be useful as a reference and for new maintainers...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657210253,https://api.github.com/repos/pydata/xarray/issues/4218,657210253,MDEyOklzc3VlQ29tbWVudDY1NzIxMDI1Mw==,14808389,2020-07-12T11:39:58Z,2020-07-12T13:23:34Z,MEMBER,"you could try to undo that by: getting the hash of the latest commit (7bf9df9d75c40bcbf2dd28c47204529a76561a3f right now), then calling ```sh git reset git push -f ``` Since I've been afraid of that mistake as well, I added a git hook that makes git refuse to push to `master` and `stable` on the main repository (use `--no-verify` to override it): ```bash $ cat .git/hooks/pre-push #!/usr/bin/env bash protected_remotes=""origin"" protected_branches=""master stable"" isin() { local list=""$1"" local substring=""$2"" for element in $list do [[ ""$element"" == ""$substring"" ]] && return 0; done return -1; } readonly() { remote=""$1"" branch=""$2"" if isin ""$protected_remotes"" ""$remote"" && isin ""$protected_branches"" ""$branch"" then return 0; else return -1; fi } remote=""$1"" IFS="" "" while read local_ref local_sha remote_ref remote_sha do branch=""$(echo $remote_ref | sed 's#^refs/heads/##g')"" if readonly ""$remote"" ""$branch"" then echo ""cannot push to $remote/$branch: protected branch. Use --no-verify to override this."" exit -1 fi done ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657213126,https://api.github.com/repos/pydata/xarray/issues/4218,657213126,MDEyOklzc3VlQ29tbWVudDY1NzIxMzEyNg==,14808389,2020-07-12T12:07:49Z,2020-07-12T12:10:35Z,MEMBER,"see this [SO question](https://stackoverflow.com/questions/46146491/prevent-pushing-to-master-on-github). However, I don't think we should try that since there are a few cases where you still need to push without a PR (releasing, mainly). So I think either a pre-push hook or `git config branch.master.pushRemote no_push` (but then you also can't push to your own master anymore) are the best way forward","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657211714,https://api.github.com/repos/pydata/xarray/issues/4218,657211714,MDEyOklzc3VlQ29tbWVudDY1NzIxMTcxNA==,14808389,2020-07-12T11:54:41Z,2020-07-12T11:54:41Z,MEMBER,"oh, yeah. Then someone with the appropriate permissions (you? or maybe @shoyer?) has to temporarily remove the branch protection (settings on github), force push, and then add back the branch protection.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009