リポジトリのemail通知を減らす:
記事:
記事:
記事:
GitHubの機能:
自分で可視化:
記事:
SaaS:
text1 -> text2 example1 -> example2 ...
gh auth login # ログインステータス gh auth status # アカウント切り替え。トグル動作 gh auth switch
記事:
記事:
# 作成者 author:<user name> is:issue is:PR is:open is:closed
```[tasklist] # title - [ ] task1 - [ ] task2 ```
日本語が追加された:
MS Learn:
試験ページは英語のみ:
記事:
記事:
/.ssh/known_hosts からgithub.comを削除。その後、再登録
ssh-keygen -R github.com curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
ssh -T git@github.com ... Offending key for IP in /home/user1/.ssh/known_hosts:51 Matching host key in /home/user1/.ssh/known_hosts:53 Are you sure you want to continue connecting (yes/no)? yes
記事:
<details> <summary></summary> ```shell ``` </details>
デフォルトではgit commitにemailが含まれるため、public repoにコミットするとbotにクロールされてspamが来る。
対策:
git config user.email "<number>+<user>@users.noreply.github.com" # ユーザー認証ができているか検証 ssh -T git@github.com Hi <user>! ...
記事:
記事:
記事:
デプロイ自動化のための方法がいくつか紹介されている。
Host example.com
ForwardAgent yes関連: Memo/Mermaid
記事:
記事:
Secret scanningはパブリックリポジトリ及びAdvanced Securityライセンスを持つOrganizationが所有するプライベートリポジトリで利用できます。
- Enterprise プランには含まれている
2021-04現在、標準機能にはチャート作成は無い
GanttStart: 2020-04-27 GanttDue: 2020-05-08
ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
確認:
ssh-add -l # 登録されている公開鍵が表示される。 ssh -T git@github.com # githubのユーザ名が表示される
/.ssh/config で ControlMaster auto だとControlPersistに指定された時間キャッシュされる。その時間を経過すれば、キャッシュが切れるので接続できるようになるはず。
解決: ControlMaster を明示的に切断する
# 現在の接続を確認 ssh -O check git@github.com # 接続が残っている場合、終了 ssh -O exit git@github.com
有効化手順:
localにある「file:///var/www/svn/dev/」をgithub private repoへ移行する:
mkdir -p git-svn/dev/ cd git-svn/dev/ # svnのrevを確認 svn info file:///var/www/svn/dev/
svn ls file:///var/www/svn/repo/ branches/ tags/ trunk/ git svn init -s --prefix=svn/ --no-minimize-url file:///var/www/svn/dev/
svn ls file:///var/www/svn/repo/ dir1 dir2 ... git svn init -s --prefix=svn/ --no-minimize-url --trunk=/ file:///var/www/svn/dev/
git svn fetch
git remote add origin git@github.com:<user>/<repo>.git git branch -M master git push -u origin master
git remote -v origin git@github.com:<YOUR_USER>/<REPO>.git (fetch) origin git@github.com:<YOUR_USER>/<REPO>.git (push)
git remote add upstream https://github.com/<ORIGINAL_USER>/<REPO>.git
git fetch upstreamgit checkout master git pull -p git merge upstream/master
git diff origin/master git push origin master
PRを作る時に選択できるようになった。
PRをDraftへ戻す。
PRのレビュー中に、数行の変更を提案したい場合に便利。
記事:
GitHubの規約的には。
IP制限をしている場合、GitHubのIPを許可する必要がある。
curl -s https://api.github.com/meta | jq .
```言語の名前 or aliases コード ```
GitHub上で、ブランチ、コミットID間の比較ができる。
レビューする人の負担が減る。
GUIの場合:
URLから直接入力する場合:
https://github.com/example/example/compare/<commit-id , branch , tag>...<commit-id , branch , tag>
# 作業用ブランチ作成 git co -b add/prod # stgからprodへコピー cp -R stg prod # 重要。このcommit-idが比較元になる。例: 1234abc git add prod git commit # prod/以下を変更してcommit git commit git push origin add/prod # stgとprodの比較用リンクで確認し、PR等に記載 https://github.com/example/example/compare/1234abc...add/prod
例:
git commit --author='User1 <user1@example.com>' -a
git config user.name "user1" git config user.email "user1@example.com"
GitHubはデフォルトで正しい秘密鍵が指定されるようだが、BitBucketでは秘密鍵を明示的に指定する必要があった
vim ~/.ssh/config ---- Host bitbucket.org User git Port 22 HostName bitbucket.org IdentityFile ~/.ssh/github_rsa TCPKeepAlive yes IdentitiesOnly yes ----
ssh-rsa AAAAB3N...YFd8w6Q== username@example.com
ssh -T git@github.com Hi <UserName> ...
# 登録されている鍵を確認 ssh-add -l # ユーザ名が正しいか確認 ssh -T git@github.com # 間違っている場合。現在の設定を削除 ssh-add -D
git commi -m "#1 fixed" git commi -m "#1 closed"
変更点を含んだブランチを元リポジトリに取り込んで貰うようにリクエストを投げる事
# 現在のbranch確認 git branch -a * master # 最新のmasterに更新 git pull # 作業用ブランチ作成とチェックアウト git checkout -b new-branch # 現在のbranch確認 git branch master * new-branch # ファイルを変更、追加 # 変更点確認 git diff . # 問題なければコミット git commit . # ブランチをリモートへプッシュ git push origin new-branch
git checkout master git pull
# 登録済み秘密鍵の確認。一つだけにしておく。 ssh-add -l # githubユーザの確認。ここで該当ユーザかを確認 ssh git@github.com git clone git@github.com:<USER>/example.git cd example/ git config --local user.name "acocunt B name" git config --local user.email "account B email"
/ssh/.config で github.comに別名を付ける方法
git clone git@github.com:<USER>/example.git cd example/ git config user.name "user1" git config user.email "user1@example.com" git config --list # ssh秘密鍵を適当な場所に置く vim ~/.ssh/github-user1_rsa chmod 600 ~/.ssh/github-user1_rsa # ssh configを変更し、適当なホスト名を付ける vim ~/.ssh/config ---- Host github-user1 User git Port 22 HostName github.com IdentityFile ~/.ssh/github-user1_rsa TCPKeepAlive yes IdentitiesOnly yes ---- # 接続テスト: 詳細を知りたければ「-v」を付ける ssh -T github-user1 Hi user1! ... # のようにgithubのuser nameが表示されれば成功 # リポジトリ中のアドレスを変更 vim .git/config ---- url = git@github-user1:REPO/git-test.git ----
git commit --amend --author="user1 <user1@example.com>" # 確認 git log
ssh-keygen -t rsa -C "your_email@youremail.com" 秘密鍵と公開鍵が出来るので保存しておく ~/.ssh/id_rsa ~/.ssh/id_rsa.pub コミットログに表示される名前とメールアドレスを設定。~/.gitconfig に保存される git config --global user.name "your_name" git config --global user.email "your_email@youremail.com"
mkdir example cd example git init touch README git add README git commit -m 'first commit' # URLに'origin' という短い別名を付ける(必須ではない) git remote add origin git@github.com:your_name/example.git # git push git@github.com:your_name/example.git master:master と同じ git push -u origin master
git clone git://github.com/your_name/example.git cd example # リモートの更新内容を反映 git pull # ファイルの追加 git add README # 全ての変更を追加 git add . # 変更の確認 git status # 差分の確認 git diff [ファイル名] # 変更を元に戻す git revert ファイル名 # 変更のコミット git commit -a # リモートリポジトリへ反映 git push
}}}