sakura-editor / management-forum

管理・運用向けフォーラム(Issues をフォーラム代わりに使う)
2 stars 0 forks source link

Git/GitHub の操作方法に関する質問部屋 #37

Open m-tmatma opened 5 years ago

m-tmatma commented 5 years ago

Git/GitHub の操作方法に関する質問部屋

ds14050 commented 5 years ago

質問ではありませんが、既出の操作方法です。

m-tmatma commented 5 years ago

Pro Git という本です。タダです。 https://git-scm.com/book/ja/v2

ds14050 commented 5 years ago

そのページは目的からコマンドを探すときに重宝しています。

git help diff とやって表示される Webヘルプでコマンドの詳細がわかっても、git diff --stagedgit diff master... にはなかなかたどり着けませんから。

両方のページ(※)を相互補完的に使っています。

git help で見られるのはインストールしたローカルコピーで、オリジナルと覚しきものは Pro Git と同じサイトで公開されていました。

m-tmatma commented 5 years ago

GitHub でライセンスを追加するの以下で簡単にできます。 https://help.github.com/articles/adding-a-license-to-a-repository/

m-tmatma commented 5 years ago

https://next.rikunabi.com/journal/tag/webdesign-manga/ マンガでわかるGit

m-tmatma commented 5 years ago

git push origin HEAD って便利です。 https://reasonable-code.com/git-push-origin-head/

トラッキングブランチを設定するときは git push -u origin HEAD としたらいいです。

※ 基本的には、常に git push -u origin HEAD でもいいかも。

m-tmatma commented 5 years ago

Git超絶まとめ https://qiita.com/masashi127/items/2e103c3fba9d1b058961

ls-files のところの説明が役に立つ https://qiita.com/masashi127/items/2e103c3fba9d1b058961#ls-files

関連 https://github.com/sakura-editor/sakura/issues/809#issuecomment-475816443

m-tmatma commented 5 years ago

Githubで一番有名なGit TIPS集 https://qiita.com/rana_kualu/items/4d5e27244256e9689304

m-tmatma commented 5 years ago

【Git for Windows】日本語文字化けの解決方法 その2 https://teratail.com/questions/94616

コマンドプロンプトで git を実行する前に set LANG=ja_JP.UTF-8 を実行したら OK です。

ds14050 commented 5 years ago

git push origin HEAD

にわかが補足します。

トラッキングブランチ(追跡ブランチ)には用語の混乱が見られます。

Git で「追跡ブランチ」って言うのやめましょう - Qiita

カギ括弧でくくった「トラッキングブランチ」は上流ブランチ(upstream branch)と呼ぶ方が良さそうです。-u オプションは upstream の u ですね。紹介があった「Git超絶まとめ」では上流ブランチとは違う方のトラッキングブランチの実体(refs/remotes/remoteName/branchName)について主に書かれています。git fetch で更新されるものと同じ。

この(リモート)トラッキングブランチからブランチを切り出すと、自動的に上流ブランチとして(リモート)トラッキングブランチが設定されているわけですね。ややこしいですね。

m-tmatma commented 5 years ago

コマンドプロンプトで

set LANG=ja_JP.UTF-8

を実行してから git diffgit log を実行すると文字化けしません。

m-tmatma commented 5 years ago

↑ もうすでに書いてた。

KENCHjp commented 5 years ago

↑自分もよくやる

m-tmatma commented 5 years ago

GitHub でのコード検索の方法

Searching code https://help.github.com/en/articles/searching-code

m-tmatma commented 5 years ago

https://github.com/sakura-editor/sakura/pull/796/files#r277152394

https://github.com/sakura-editor/sakura/pull/796/files?short_path=c512f63#diff-c512f638c2c30e7002c14e923d0a732f だと差分が見やすい。

"Copy path", "View file" と並んでいるところの左にドキュメントのアイコンがあって、 そこをクリックすると(表示したときの)差分がわかりやすく表示されます。

Display the rich diff というものです。

m-tmatma commented 5 years ago

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

m-tmatma commented 5 years ago

けっこうみんな知っていると思うけど、GitHub 上での表記方法

Basic writing and formatting syntax https://help.github.com/en/articles/basic-writing-and-formatting-syntax

m-tmatma commented 5 years ago

けっこうみんな知っていると思うけど、GitHub 上での表記方法

ついでにこれも https://daringfireball.net/projects/markdown/syntax

m-tmatma commented 5 years ago

Markdownの参照形式によるリンク という機能があります。

https://github.com/sakura-editor/sandbox/pull/23 で試してみました。

m-tmatma commented 5 years ago

Git 2.9でdiffがちょっとかしこくなった https://taisablog.com/archives/46

m-tmatma commented 5 years ago

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

m-tmatma commented 5 years ago

https://resources.github.com/videos/GitHub-new-features-for-enterprise-SW-development/ https://github.blog/changelog/

m-tmatma commented 5 years ago

https://resources.github.com/whitepapers/ https://resources.github.com/videos/

m-tmatma commented 5 years ago

Star history - GitHubのスター獲得履歴をグラフ化して比較できるWebサービス https://www.softantenna.com/wp/webservice/star-history/ https://star-history.t9t.io/#sakura-editor/sakura

m-tmatma commented 5 years ago

Jasper http://blog.h13i32maru.jp/entry/2018/07/17/083215 http://blog.h13i32maru.jp/entry/2016/06/08/090000

berryzplus commented 5 years ago

ツールの名前って意外と大事だと思いました。

Jasper = 古くからあるJAVAのjspエンジンと同じ名前。

自前ツールにApacheと名付けるようなもんです… どんなに出来が良くても名前で敬遠されそう。

m-tmatma commented 5 years ago

https://www.youtube.com/watch?v=9DZSty2KsJ8 https://gis-oer.github.io/gitbook/book/materials/web_gis/GeoJSON/GeoJSON.html https://education.github.com/teachers/advisors

m-tmatma commented 5 years ago

https://github.com/sindresorhus/refined-github これ便利。ブラウザのプラグインです。

こんな感じ

screen
m-tmatma commented 5 years ago

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 のチェックを外すとオリジナルの表示になります。

m-tmatma commented 5 years ago

https://help.github.com/ja#dotcom

GitHubヘルプドキュメントが日本語化されました - The GitHub Blog - Japan https://github.blog/jp/2019-06-28-japanese-help-document/

m-tmatma commented 5 years ago

Visual Studio Code のプラグイン GitHub Pull Requests 便利そう https://tech.studyplus.co.jp/entry/2018/10/01/100803

m-tmatma commented 5 years ago

~↑ Visual Studio 用もあるみたい~ https://marketplace.visualstudio.com/items?itemName=VSIDEVersionControlMSFT.pr4vs

GitHub 用ではなかった。

m-tmatma commented 4 years ago

https://help.github.com/ja/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue

PR と issue の関連付けを UI 上で行えるようになったみたい。

m-tmatma commented 4 years ago

Flight rules for Git

https://blog.labot.jp/entry/2019/07/01/183204 https://github.com/k88hudson/git-flight-rules

m-tmatma commented 4 years ago

へー、知らんかった。 https://blog.labot.jp/entry/2019/07/01/183204#i-want-to-checkout-to-a-remote-branch-that-someone-else-is-working-on

--track-t と省略できます。

m-tmatma commented 4 years ago

GitHub CLI というものがリリースされている。 https://cli.github.com/

例えば

gh pr checkout 1221

とかやれば、PR1221 をチェックアウトできる。

↑ もう get-PR.bat とか要らない。

m-tmatma commented 4 years ago

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