Open m-tmatma opened 5 years ago
質問ではありませんが、既出の操作方法です。
Pro Git という本です。タダです。 https://git-scm.com/book/ja/v2
そのページは目的からコマンドを探すときに重宝しています。
git help diff
とやって表示される Webヘルプでコマンドの詳細がわかっても、git diff --staged
や git diff master...
にはなかなかたどり着けませんから。
両方のページ(※)を相互補完的に使っています。
※git help
で見られるのはインストールしたローカルコピーで、オリジナルと覚しきものは Pro Git と同じサイトで公開されていました。
GitHub でライセンスを追加するの以下で簡単にできます。 https://help.github.com/articles/adding-a-license-to-a-repository/
git push origin HEAD
って便利です。
https://reasonable-code.com/git-push-origin-head/
トラッキングブランチを設定するときは
git push -u origin HEAD
としたらいいです。
※ 基本的には、常に git push -u origin HEAD
でもいいかも。
Githubで一番有名なGit TIPS集 https://qiita.com/rana_kualu/items/4d5e27244256e9689304
【Git for Windows】日本語文字化けの解決方法 その2 https://teratail.com/questions/94616
コマンドプロンプトで git を実行する前に
set LANG=ja_JP.UTF-8
を実行したら OK です。
git push origin HEAD
にわかが補足します。
git remote -v
で origin がどこのリポジトリ URL のエイリアスであるかが見られます。HEAD:remoteBranchName
と書きます。git push origin HEAD:remoteBranchName
の origin と remoteBranchName の入力を次回以降省略するために、-u オプションで HEAD と関連づけて記憶させる。git branch -vv
でブランチと「トラッキングブランチ」の関連付けが一覧できる。トラッキングブランチ(追跡ブランチ)には用語の混乱が見られます。
「Git で「追跡ブランチ」って言うのやめましょう - Qiita」
カギ括弧でくくった「トラッキングブランチ」は上流ブランチ(upstream branch)と呼ぶ方が良さそうです。-u オプションは upstream の u ですね。紹介があった「Git超絶まとめ」では上流ブランチとは違う方のトラッキングブランチの実体(refs/remotes/remoteName/branchName)について主に書かれています。git fetch で更新されるものと同じ。
この(リモート)トラッキングブランチからブランチを切り出すと、自動的に上流ブランチとして(リモート)トラッキングブランチが設定されているわけですね。ややこしいですね。
コマンドプロンプトで
set LANG=ja_JP.UTF-8
を実行してから git diff
や git log
を実行すると文字化けしません。
↑ もうすでに書いてた。
↑自分もよくやる
GitHub でのコード検索の方法
Searching code https://help.github.com/en/articles/searching-code
https://github.com/sakura-editor/sakura/pull/796/files#r277152394
"Copy path", "View file" と並んでいるところの左にドキュメントのアイコンがあって、 そこをクリックすると(表示したときの)差分がわかりやすく表示されます。
Display the rich diff というものです。
Using search to filter issues and pull requests https://help.github.com/en/articles/using-search-to-filter-issues-and-pull-requests
例えば state:open type:pr review:none
とすると最後に push したから誰にもレビューされていない PR をフィルタリングできます。
以下は UI 上で行う方法 https://help.github.com/en/articles/filtering-issues-and-pull-requests
けっこうみんな知っていると思うけど、GitHub 上での表記方法
Basic writing and formatting syntax https://help.github.com/en/articles/basic-writing-and-formatting-syntax
けっこうみんな知っていると思うけど、GitHub 上での表記方法
Markdownの参照形式によるリンク という機能があります。
Git 2.9でdiffがちょっとかしこくなった https://taisablog.com/archives/46
CI の失敗した PR を見たいとき、フィルタとして status:failure
を指定する。
→ is:pr is:open status:failure
をフィルタとして指定すると
→ https://github.com/sakura-editor/sakura/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+status%3Afailure+ のようになる。
https://github.blog/2015-06-02-filter-pull-requests-by-status/ https://github.com/sindresorhus/refined-github/issues/1806#issuecomment-466612012
Star history - GitHubのスター獲得履歴をグラフ化して比較できるWebサービス https://www.softantenna.com/wp/webservice/star-history/ https://star-history.t9t.io/#sakura-editor/sakura
ツールの名前って意外と大事だと思いました。
Jasper = 古くからあるJAVAのjspエンジンと同じ名前。
自前ツールにApacheと名付けるようなもんです… どんなに出来が良くても名前で敬遠されそう。
https://github.com/sindresorhus/refined-github これ便利。ブラウザのプラグインです。
こんな感じ
sindresorhus/refined-github これ便利。ブラウザのプラグインです。
こんな感じ
https://github.com/sindresorhus/refined-github/issues/1843 https://github.com/sindresorhus/refined-github/pull/1858#issuecomment-478218739
hide-watch-and-fork-count
のチェックを外すとオリジナルの表示になります。
https://help.github.com/ja#dotcom
GitHubヘルプドキュメントが日本語化されました - The GitHub Blog - Japan https://github.blog/jp/2019-06-28-japanese-help-document/
Visual Studio Code のプラグイン GitHub Pull Requests
便利そう
https://tech.studyplus.co.jp/entry/2018/10/01/100803
~↑ Visual Studio 用もあるみたい~ https://marketplace.visualstudio.com/items?itemName=VSIDEVersionControlMSFT.pr4vs
GitHub 用ではなかった。
https://help.github.com/ja/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
PR と issue の関連付けを UI 上で行えるようになったみたい。
--track
は -t
と省略できます。
GitHub CLI というものがリリースされている。 https://cli.github.com/
例えば
gh pr checkout 1221
とかやれば、PR1221 をチェックアウトできる。
↑ もう get-PR.bat とか要らない。
PR のリストは以下でとれる。
>gh pr list
Showing 27 of 27 pull requests in sakura-editor/sakura
#1221 検索ボックスでリストのドロップダウン中にDeleteキーを... berryzplus:feature/fix_del_key_action
#1220 [WIP] .clang-format を試してみた berryzplus:work_in_progress/try_clang_format
#1201 [WIP} バージョン情報にリッチエディットを使う検討 berryzplus:pending/rich_version_info
#1179 [WIP] ソースコードの整形の実験 (PR1172 との比較用) m-tmatma:research/feature/EditFormatDocument-compare...
#1172 [WIP] ソースコードの整形の実験 m-tmatma:feature/EditFormatDocument-compare-point2
#1161 [WIP] カスタムメニュー2 を使って #1100 の実験 m-tmatma:research/feature/issue1100-submenu-new-menu...
#1150 [WIP] CDataProfileの通常変換からStaticStringを切り離す berryzplus:feature/split_custom_string
#1076 [WIP] ファイル読み込みを高速化する変更 beru:speed_up_loading_file
#998 [WIP] CGraphics 関連の最適化 beru:CGraphics_SaveDC_RestoreDC
#899 PR #894 の不備・不整合を正します。 ds14050:FollowMissingGTest
#847 WIP: HDC を再利用して CaretUnderLineON に使う beru:CaretUnderLineON
#801 強調表示のキーワードを更新(HTML/CSS/UWSC) KageShiron:add/keywords
#787 [WIP]build-installerとzipArtifacts.batの簡略化 KageShiron:filelist
#731 [WIP] sphinx の導入のベースを作る m-tmatma:feature/sphinx-basis
#714 [WIP] 非同期カウントを実装してみた。 berryzplus:feature/add_async_find
#699 [WIP] 改行マークの線の太さを調整 beru:DrawEOL_PenWidth
#687 [WIP] ダイアログの位置が表示するたびにずれていく問題... beru:SetDialogPosSize
#682 [WIP] diffとC/Migemoを追加 KageShiron:add/diff-migemo-2
#681 Fix/expand externals KageShiron:fix/expand-externals
#679 Rewrite zip_artifacts.bat, build-installer.bat ds14050:rewrite_zipArtifacts.bat
#650 [WIP] AppVeyor のビルドキャッシュを利用してビルド時... ds14050:RestoreCommitterDate
#630 [WIP] インストーラの同梱ファイルの調整 KageShiron:add/diff_migemo
#626 ビルド時間とアーティファクトサイズの軽減が狙いですが... ds14050:cppcheckminus_revised
#570 [WIP] リンクテキストの処理に SysLink を使う m-tmatma:feature/syslink
#524 [WIP] x64での警告修正(CMemory::AllocBuffer の引数を ... m-tmatma:feature/x64-CMemory-AllocBuffer-size_t
#459 [WIP] 共通設定ダイアログの仕様まとめ m-tmatma:feature/doc-common-setting-spec
#378 [WIP] cmake 対応の実験 (part2) 更新版 m-tmatma:feature/WIP-cmake-experiement-take2
Git/GitHub の操作方法に関する質問部屋