LoginSignup
6
5

More than 5 years have passed since last update.

Git で空ブランチ(根が複数のリポジトリ)を作る

Posted at

GitHub の Project Pages のような空ブランチ(根が複数のリポジトリ)の作り方は次の通りですが・・・

どうにもこれが覚えられません。

orphan なんて英単語知らないし。

git rm -rf . とかなんだかドキドキするし。

(人によりけりですが)そもそも master と gh-pages は別々にチェックアウトした方が捗るって気がするし。


まっさらなリポジトリを作って push すれば良いんじゃ? と思いました。

$ mkdir gh-pages
$ cd gh-pages

$ git init
$ git checkout -b gh-pages
$ echo testing > index.html
$ touch index.html
$ git add index.html
$ git commit -m first

$ git remote add -t gh-pages origin git@github.com:ngyuki/testing.git
$ git push -u origin gh-pages
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5