20210729のGitに関する記事は3件です。

PreonicをMassdropから数年後に使い始めるつもりがコンパイルに失敗した

数年前に、Massdrop(現Drop)からPreonicを購入した。 しかし、当時はなかなか購入できず、Planckやそのロウプロファイル(ロープロファイル?)版を先に入手して使っていた。 一応満足していたため、本命のプレオニック(orプリオニック)(カタカナ表記合っている?)を入手したまま放置してしまった。 今回、数年ぶりに取り出し、キーマップをプランクに併せるつもりで変更した。 その前準備として、数ヶ月ぶりにQMKを最新版にしようと思った。 make preonic/rev3:chesscommands:dfu-util その作業でコンパイルに失敗するというか、そもそもコンパイルが進まない。 おう、まい がっ!! コンパイルが進まない判断材料 プロセスを確認したとき、以下のように処理が止まったまま動かない(S+)。 数時間放置したが、動く気配がない。 compile作業 $ ps aux | grep make | grep -v grep chesscommands 5608 0.0 0.2 4314224 37900 s002 S+ 11:57AM 0:02.35 /Applications/Xcode.app/Contents/Developer/usr/bin/make preonic/rev3:chesscommands $ レディットで質問したのだが、解決しないまま放置されている。 GitHubから最新版のQMKと統合(マージ) 基本的な流れ。 makeコマンド確認 # 移動 cd ~/qmk_firmware # リモート追跡ブランチに本物のQMK-URLを追加する。 git remote add upstream https://github.com/qmk/qmk_firmware.git # 追加確認 git remote -v # リモート追跡ブランチから取得(フェッチ)。 git fetch upstream # 現行との比較。 git diff HEAD..FETCH_HEAD # 実際のマージ git merge upstream/master # 競合が発生した場合、解消する。 git mergetool # 解消確認 git status # 既存環境削除 make clean # サブモジュールのコンパイル実施。 make git-submodule # 実際のコンパイル及びキーボード本体の更新 #make planck/rev6:chesscommands:dfu-util #make planck/light:chesscommands:dfu #make preonic/rev3:chesscommands:dfu-util # リモート追跡ブランチ削除 git remote rm upstream # コンパイルが通っている場合、Githubに送出する。 git push origin master ここで不思議なのは、そもそもサブモジュールすら正常にコンパイルが通らなかったこと。 git-submodule $ make git-submodule QMK Firmware 0.13.24 Synchronizing submodule url for 'lib/chibios' Synchronizing submodule url for 'lib/chibios-contrib' Synchronizing submodule url for 'lib/googletest' Synchronizing submodule url for 'lib/lufa' Synchronizing submodule url for 'lib/printf' Synchronizing submodule url for 'lib/ugfx' Synchronizing submodule url for 'lib/vusb' $ 書き換えはない? 原因究明 順に説明するとして、まずは、、、 環境構築のやり直しをした。 必要なコマンドは、brew install qmk/qmk/qmkだった。 警告は出ていたが、特に問題なくインストールできたと思っていた。 しかし、 今回のQMKに関係ないと思われていたメッセージを改めて確認した。 message Warning: Your Xcode (11.3) is outdated. Please update to Xcode 11.3.1 (or delete it). Xcode can be updated from the App Store. Warning: A newer Command Line Tools release is available. Update them from Software Update in System Preferences or run: softwareupdate --all --install --force If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install Alternatively, manually download them from: https://developer.apple.com/download/more/. You should download the Command Line Tools for Xcode 11.3.1. 原因究明の大本命 上記の警告(ワーニング)メッセージが全てを解決してくれる案内でした。 softwareupdate インストール softwareupdate $ softwareupdate --all --install --force Software Update Tool Finding available software Downloaded Safari Downloading macOS Mojaveセキュリティアップデート2021-005 Downloaded macOS Mojaveセキュリティアップデート2021-005 Preparing macOS Mojaveセキュリティアップデート2021-005 Installing macOS Mojaveセキュリティアップデート2021-005, Safari Done with Safari Done. To install these updates, your computer must shut down. Your computer will automatically start up to finish installation. Installation will not complete successfully if you choose to restart your computer instead of shutting down. Please call halt(8) or select Shut Down from the Apple menu. To automate the shutdown process with softwareupdate(8), use --restart. $ 端末再起動。 CommandLineTools Macにインストールしたのが数年前のはずで、アップデートしたつもりが全くしていなかっただろうことが判明した瞬間でもある。 CommandLineTools $ sudo rm -rf /Library/Developer/CommandLineTools Password: $ ll /Library/Developer/CommandLineTools ls: /Library/Developer/CommandLineTools: No such file or directory $ sudo xcode-select --install xcode-select: note: install requested for command line developer tools $ 改めてやり直し(qmk/qmk/qmk) もう一度インストールを行った。 qmk/qmk/qmkインストール $ brew install qmk/qmk/qmk Updating Homebrew... ==> Auto-updated Homebrew! Updated Homebrew from 071d769b0 to 3e52e8b48. Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-fonts). ==> New Formulae bash_unit ==> Updated Formulae Updated 25 formulae. ==> Updated Casks Updated 28 casks. ==> Homebrew was updated to version 3.2.4 The changelog can be found at: https://github.com/Homebrew/brew/releases/tag/3.2.4 Warning: qmk/qmk/qmk 0.2.2 is already installed and up-to-date. To reinstall 0.2.2, run: brew reinstall qmk $ 蓋を開けてびっくり 解決できればたいしたことない作業だが、解決までに数時間を費やしてしまった。 何とも情けない。 こんなことでは就職もままならないはずだよ・・・。 以上。
  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

パスワードでのGit操作を禁止 トークン認証手順

■背景 いつも通りに、git操作を行っていると、突然push時に、下記エラーが出力されました。 clone,pullなどもできない!!? remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead. remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information. fatal: unable to access 'https://github.com/repository.git/': The requested URL returned error: 403 そのため、調査してみました。 GitHub、2021年8月13日以降パスワードでのGit操作を禁止 (https://news.mynavi.jp/article/20201222-1604003/) の記事を発見しました。 ■原因 これまでローカルでリモート(github)にアクセスするためにはパスワード認証で問題ありませんでした。 しかし、脆弱性防止のために個人アクセストークン認証に変更になるみたいです。(2021年8月13日にパスワード認証廃止) さらに、詳細を確認すると、 下記の期間は一時的にパスワード認証が停止され、パスワードを使ったGit操作ができなくなる。 エラーが出たのは2021年7月28日18時頃だったので、下記が原因かと思います。 2021年6月30日 UTC 7時から10時(日本時間 同16時から19時) 2021年6月30日 UTC 16時から19時(日本時間 7月1日1時から4時) 2021年7月28日 UTC 7時から10時(日本時間 同16時から19時) 2021年7月28日 UTC 16時から19時(日本時間 7月19日1時から4時) ■パスワード認証からトークン認証に変更 2021年8月13日以降パスワードでのGit操作を禁止になるため、早々にトークン認証に切り替えたので、方法を記載します。 1. キーチェーンアクセスを開き、gitを検索し、インターネットパスワードを削除します。 2.トークンの生成を行う。 githubにログインし、setting→Developer Setting→Personal access tokens→Generate New Token をクリックし、Note(タイトル)、Expiration、repoにチェックを入れてトークンを生成します。 ※トークンが表示されるので、保管しておきましょう。 3. トークン認証を設定する 下記、でトークンを設定しましょう。 ■パターン1 git remote set-url origin https://{トークン名}@github.com/{リポジトリ名}.git  リポジトリ名などを間違えてしまうと、下記のようにエラーが出力されます。 remote: Not Found fatal: repository 'https://github.com/リポジトリ名.git/' not found トークン認証を設定後、下記、コマンドでリモートのリポジトリと一致しているか確認してみましょう。 git remote -v ■パターン2 上記は、直接トークンを設定しています。毎回パスワードを求められずに操作できるので便利ですが、セキュリティ的に問題がある場合があります。 なので、 トークンを設定せずに、毎回入力を求められるように設定します。 vim .git/config まず、gitの設定ファイルをvimモードで開きます。 そして、下記の urlをユーザー名のみに設定します。 [remote "origin"] url = https://ユーザー名@github.com/リポジトリ名.git fetch = +refs/heads/*:refs/remotes/origin/* すると、 リモート操作時は、パスワードが求められるので、トークンを入力しましょう。 ■最後に 既に、パスワード認証中にgit cloneしてきたものは、上記の手順でgit操作が可能になりますが、 トークン認証後にgit cloneしてきたものは、上記の設定は不要になります。 以上、最後まで閲覧頂きありがとうございます。
  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

git pushでPlease use a personal access token instead 的なエラーの解消方法

概要 remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead. remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information. fatal: unable to access 'リポジトリ名': The requested URL returned error: 403 ある日突然的なエラーが出て、pushが出来なくなった。 解消法 ここで personal access tokenを作成し、メモをしておく。 そしたら、該当リポジトリのルートでoriginを書き換える $ git remote set-url origin https://<githubのユーザー名>:<さっき取得したトークン>@github.com/リポジトリ.git でpushが出来るようになる
  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む