
tootsuite/mastodonは、本家マストドンのリポジトリです。
hyuki0000/mastodonは、本家マストドンのリポジトリをforkして作ったリポジトリです。
~/mastodonは、結城がふだん使っているリポジトリです。
hyuki0000/mastodonをcloneして作りました。tootsuite/mastodonの更新をpullしてきます。これによって、本家のバージョンアップに追従するのです。upstreamは、本家のリポジトリtootsuite/mastodonに対して結城が付けたリモート名です。originは、結城のリポジトリhyuki0000/mastodonに対して結城が付けたリモート名です。
origin/masterは本家を追っかけるブランチ。ここには結城固有の修正は入れません。origin/social.hyuki.netは運用のためのブランチ。こちらに結城固有の修正を入れます。upstream/master →
origin/master → origin/social.hyuki.net
とマージしています。
upstream/master → origin/master
のコマンド例git branch
git checkout master
git fetch upstream master
git merge upstream/master
git push origin master
git branch -av
origin/master → origin/social.hyuki.net
のコマンド例git branch
git checkout social.hyuki.net
git diff master
git merge master
git reset --hard ORIG_HEAD  # マージ失敗のとき
git merge master
open -a sourcetree .        # 競合の解決とタグ打ち
git push/opt/mastodonは、さくらのVPS上にある結城のリポジトリです。
hyuki0000/mastodonをcloneして作りました。hyuki0000/mastodonにpushします。cd /opt
tar cvf mastodon.YYYY-MM-DD.tar mastodon
mastodon-stop
git branch
git remote -v
git checkout social.hyuki.net
git fetch --tags origin
git merge hyuki-v1.4.3 # ←これ正しいの?
docker-compose pull
# Dockerfile UID, GIDを1000に変更
docker-compose build
docker-compose run --rm web rails db:migrate
docker-compose run --rm web rails mastodon:maintenance:prepare_for_foreign_keys
docker-compose run --rm web rails db:migrate
docker-compose run --rm web rails assets:precompile
# https://gist.github.com/hyuki0000/22ca73f80b001ddb39dba1e87e01826f
# Dockerfile yarn@0.18.2に変更
# See: https://github.com/tootsuite/mastodon/issues/3251
##### docker-compose run --rm web rails r Rails.cache.clear
hyuki0000/mastodonにはmasterブランチとsocial.hyuki.netブランチがあります。
masterブランチは本家を追い続けます。social.hyuki.netブランチは結城が公開しているサイトを表します。hyuki0000/mastodonをcloneした後、upstreamというリモートで本家を参照し、originで結城のリポジトリを参照しますupstream/masterをpullしてoriginにpushします。ここでは単に追いかけるだけなので問題は起きないはず。social.hyuki.netブランチに対して作業をしてorigin/social.hyuki.netにpushします。その後、Sakura
VPSの方で同じブランチをpullします。たとえば、oopsの画像(かわいい)はこれで入れ換えました。origin/social.hyuki.netブランチにマージします。自サイトが動かないなどの状況に備えて、過去の区切りがいいところにタグを打って戻れるようにします。
hyuki-v1.3.2,
hyuki-v1.3.3のように本家のバージョンに追従したバージョンにします。hyuki-2017-05-08
のように日付のものも入れるかも。