AWS / PHP / Python ちょいメモ

amazon web service , PHP, Python を使ったときのメモ。日本語でググってもわからなかった事を中心に。

GitHubでaws-sdk-phpをフォーク

ちょっと思い立って、aws-sdk-phpをフォークしてみました。

GitHubのドキュメントにそって実施すれば、数ステップの簡単さ!最近の開発系サイトは、どこもドキュメントが分かりやすくて素敵です。

Contribute出来る様、ちょと試行錯誤してみます。

事前準備

事前にGitHubアカウント作成しておいて、プラットフォームに合わせてツールをダウンロードしておきましょう。

プロジェクトに貢献する

  • Step 1: 目的のリポジトリを「Fork」する
  • Step 2: 自分のForkを「Clone」する
    • 「Fork」しただけではGitHub上にしか存在しないので、プロジェクト上で働けるように「Clone」してローカルPC上にもってこよう
    • aws-sdk-phpを「Fork」した場合は、こちら
git clone https://github.com/username/aws-sdk-php.git
  • Step 3: 「remote」を設定
    • リポジトリがCloneされると、default remoteとして「origin」が自身のForkしたリポジトリを指すように設定されます。これはFork元のオリジナルではないです。
    • オリジナルリポジトリを追える様、「upstream」という別名のremoteを設定しましょう
    • aws-sdk-phpの場合
cd aws-sdk-php
# Changes the active directory in the prompt to the newly cloned "aws-sdk-php" directory
git remote add upstream https://github.com/aws/aws-sdk-php.git
# Assigns the original repository to a remote called "upstream"
git fetch upstream
# Pulls in changes not present in your local repository, without modifying your files

この先、できる事

git push origin master
  • upstreamの変更をPullできます
    • オリジナルのリポジトリのアップデートを自身のmasterに反映
git fetch upstream
# Fetches any new changes from the original repository
git merge upstream/master
# Merges any changes fetched into your working files
  • branchを作れます
  • pull requestを送れます
    • もしオリジナルに対して貢献しようと望むなら、オリジナルの開発者にpull requestを送れます
  • main repositoryのwatchを辞められます
    • ポピュラーなリポジトリをForkした場合、望まない更新情報を多く目にする事になるでしょう。
    • この場合、次の手順で更新情報を受け取らないようにできます。
    • メインリポジトリ画面右上の "Unwatch" ボタンを押し、"Not Watching"を選択
  • あなたのForkを削除できます
    • もし削除を決めたときは、レギュラーリポジトリと同じ手順で削除できます