Giter Club home page Giter Club logo

Comments (5)

bake0937 avatar bake0937 commented on July 30, 2024

現在の状態

GitHubの状態

image

普通のmasterへの直pushはできる

$ git commit --allow-empty -m "test"
[master db1e93e] test
$ git push origin master
Counting objects: 1, done.
Writing objects: 100% (1/1), 181 bytes | 181.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To github.com:camp17-extra/poptweet-api.git
   4bf351d..db1e93e  master -> master

from poptweet-api.

bake0937 avatar bake0937 commented on July 30, 2024

一応、さっきのテストでコミットしたやつは戻しておこう...
なるほど....Protected branchをmasterに設定するとforce pushできないのか
一旦Protected branchの設定は外してforce pushして、さっきのからコミットは消しておきます

$ git push -f origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: Cannot force-push to a protected branch
To github.com:camp17-extra/poptweet-api.git
 ! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to '[email protected]:camp17-extra/poptweet-api.git'

GithubでProtectd branchの設定を外す

再度、やってみる

$ git push -f origin master
Total 0 (delta 0), reused 0 (delta 0)
To github.com:camp17-extra/poptweet-api.git
 + db1e93e...4bf351d master -> master (forced update)

成功した。
テストCommitを消しました

from poptweet-api.

bake0937 avatar bake0937 commented on July 30, 2024

https://qiita.com/kazuph/items/825d9d3ff9cacc279bbc の記事を参考に
特定ブランチへのマージ時にステータスチェックを必須にするも設定した

image

from poptweet-api.

bake0937 avatar bake0937 commented on July 30, 2024

git push origin masterを防ぐには個々のPCでgit hooksを設定しないといけないみたい
https://qiita.com/akymrk/items/b46b03b313850e3ae418

from poptweet-api.

bake0937 avatar bake0937 commented on July 30, 2024

とりあえず、git push -f origin master が防いでいることはわかったので、closeします
git push origin masterを防ぐには個々のPCでgit hooksを設定する感じになりそうです

from poptweet-api.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.