Github
#Git
githubに公開鍵を登録し
ローカルでリモートセットする
vi ~/.ssh/config
code:conig
Host github.com
User git
Hostname github.com
IdentityFile ~/.ssh/id_rsa
code:setup_repository.sh
ssh -T github
git remote -v
#git cloneするやつ
git remote set-url origin git@github.com:リポジトリ(~/~.git)
新しい SSH キーを生成して ssh-agent に追加する
https://docs.github.com/ja/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
----
テンプレートリポジトリ
https://docs.github.com/ja/github/creating-cloning-and-archiving-repositories/creating-a-template-repository
テンプレートリポジトリを元にリポジトリを作成可能
---
デプロイ
Managing Deploy Keys
https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys
https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys
秘密鍵を対象サーバーにデプロイしておく。
リポジトリごとにアクセスキーを設定可能(read, write)
マシンユーザー
一つのサーバーが復数のリポジトリをpullする必要が有る場合、マシンユーザーを設定する
マシンユーザーに公開鍵を設定しておく。
アクセストークン
https://docs.github.com/ja/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token
個人アカウントのアクセストークンの他にはないか
Compare
https://docs.github.com/ja/github/committing-changes-to-your-project/comparing-commits
commit IDを比較するにはcompare/commit_id..commit_idでcommit IDをドット2つで区切って比較できる。
---
git fork
git remote add upstream url
local clone上でオリジナルリポジトリをリモートに加える
https://help.github.com/ja/github/getting-started-with-github/fork-a-repo
同期
単にupstreamをlocal masterにマージする
https://help.github.com/ja/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
------------------
Github情報
star ranking
https://gitstar-ranking.com/
github tranding
https://github.com/trending?since=monthly&spoken_language_code=en
Awesome Repository
------------------------------
GCM Core
ユニバーサルクレデンシャル
https://github.com/microsoft/Git-Credential-Manager-Core
-----------------------------------
hubコマンド
https://dev.classmethod.jp/articles/hub/
clone リポジトリをクローンする。URL指定ではなく github/hub のような指定だけでクローンできる。
pull-request プルリクエストを作成する。-b オプションでベースブランチを指定できる。
fork リポジトリをフォークする。
create リポジトリを新規作成する。
browse リポジトリをブラウザで開く。
compare 特定のブランチとローカルブランチの Compare ページをブラウザで開く。
release リリースを一覧する、または新規作成する。
issue Issue を一覧する、または新規作成する。
ci-status CI のステータスを取得する。
リポジトリ移譲
https://docs.github.com/ja/github/administering-a-repository/transferring-a-repository
Danger Zone(危険地域) で、Transfer(移譲) をクリックしてください。
Transferで移譲対象のアカウントを指定して、移譲する。
ghコマンド
pacman -S github-cli
GitHub CLI | Take GitHub to the command line
https://cli.github.com/manual/gh_repo_list
gh repo list <owner>
organizationのリストを取得する場合、ownerのところにorganization名指定
プラン
組織アカウント
https://github.com/pricing
プラン
https://docs.github.com/ja/billing/managing-billing-for-your-github-account/upgrading-your-github-subscription
team,Enterpriseプランで、Privateリポジトリに対し、外部Collaboratorsを追加するには、add seatsで、seatを追加する必要がありそう。有料。
コミットメッセージ変更
コミットメッセージの変更 - GitHub Docs
git rebase -i HEAD~3
3コミットを対象にrebase
reword = use commit, but edit the commit message
pick を rewordに変更して保存
コミットメッセージを書き換える
git push --force origin EXAMPLE-BRANCH
---
Git rebaseでブランチをアップデートする場合
Githubのプルリクエストで、Git rebase
ローカルブランチで、git rebase