sshの認証鍵を作りたい
ssh-keygen
git
リモートリポジトリの確認
git remote -v
リモートリポジトリの設定削除
git remote rm {originとか}
全てチェックアウト(または変更を破棄)したい
git checkout . && git submodule foreach --recursive git checkout .
git submodule foreach --recursive {やりたいコマンド}
は結構使える。
クローンで recursive 忘れてサブモジュールが空っぽ
git submodule update --init --recursive
git の ssh 接続で複数のアカウントを取り扱う
~/.ssh/config
Host XXXX.bitbucket.org # XXXX を任意に設定
HostName bitbucket.org # ここは実際のアクセス先 (HostとHostNameがテレコじゃん。。。)
User YYYY
PreferredAuthentications publickey
IdentityFile /***/.ssh/*** # 公開鍵へのフルパス
UseKeychain yes
AddKeysToAgent yes
各リポジトリ/.git/config
[remote "origin"]
url = git@XXXX.bitbucket.org:YYYY/***.git
これで接続できない場合
ssh
で接続してみる。
ssh -T XXXX.bitbucket.org
成功時のメッセージ
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
これがエラーにならないのであれば、この状態で再度 git
でアクセスすると接続できる。(何で?)
クローンしたら、先方のsshのfingerprintが更新されたっぽい
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
~/.ssh/known_hosts
で該当のドメインの行を削除
~/.ssh/known_hosts
github.com ssh-rsa XXXXXXX.......
下記コマンドで更新
ssh -T git@github.com
D25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
XCode
ビルドキャッシュを削除
CLIじゃなくて、IDEで用意して欲しい
rm -rf ~/Library/Developer/Xcode/DerivedData
XCBuild の切替
設定
sudo xcode-select --switch /Applications/Xcode.app
確認
xcode-select --print-path