Closed12
【Git】Gitメモ

gitStash
- Apply Stash = Stashしたものを残したまま取り込む
- Pop Stash = Stashしたものは残さず取り込む
特に残す必要もない時は【Pop Stash】を選択します。

Issue
Commit連携
Commit時のコメントにチケット番号(#1 等)を含めれば、該当Issusにリンクが生成されるため、変更を追うことも容易になります。
Projectsについて
Issuesの各チケットを横断的に管理できる
デフォルトのラベルの種類
ラベル | 説明 |
---|---|
bug | バグ |
documentation | ドキュメントに関するIssue |
duplicate | 重複しているIssue |
enhancement | 新しい機能や改善 |
good first issue | 初心者向けのIssue |
help wanted | 改善方法が見いだせていないIssue |
invalid | 正しくないIssue |
question | 質問 |
wontfix | 対応をしないIssue |
イシューのテンプレート
# 概要/Overview
# 詳細/Detail
# 再現手順/Reproduction Procedure
# 現状の状態/Status
# キャプチャまたは動画(あれば貼り付け)/Capture or video (paste if available)
# 考えられる原因/Possible causes
# 修正案/Proposed amendment

git.enableSmartCommit

イシューラベルの高中低
visual | Label name | Description | Color |
---|---|---|---|
![]() |
:fire:priority-high | priority:-high | #B60205 |
![]() |
:pen:priority-medium | priority-medium | #ee7800 |
![]() |
:tea:priority-low | priority-low | #C2E0C6 |
他案
priority-medium: :オレンジの丸特大:
priority-low: :緑の丸特大:
priority:-high: :赤い丸:

- 最低限の設定

GithubでTodo管理をしている方向け:issueを自動的にProjectに追加する方法

githubアカウントを複数使い分ける
includeIfを使うとディレクトリ単位でGitの設定を変更できるのでおすすめです。
自分は下記のように設定しています。
[includeIf "gitdir:~/development/company/"]
path = .gitconfig_company
[includeIf "gitdir:~/development/private/"]
path = .gitconfig_private
特定のディレクトリに対して .gitconfig_private を使用し、それ以外のすべての場合に .gitconfig を適用したい場合、以下のように設定を追加すると良いでしょう。
[user]
# Default configuration
name = Your Name
email = your_main_email@example.com
[includeIf "gitdir:/user/to/path/workspace-main/"]
path = ~/.gitconfig_private
VSCode の GitHub アカウントを使い分ける
VSCode でも 2 つの GitHub アカウントを使い分けたい方におすすめなのが「Visual Studio Code Insiders」です。
こちらからダウンロードできます。
Documentsを正しく頭文字大文字じゃ無いとvscode認識しない
[user]
name = ~~~~~
email = ~~~~~
[includeIf "gitdir:~/Documents/dev/git-private/"]
path = ~/.gitconfig_private

わすれがちな

cd ~/.ssh
ssh-keygen -t rsa -C main@example.com -f github_private
~/.ssh/config
# 個人アカウント用
Host private.github.com
HostName github.com
User git
TCPKeepAlive yes
IdentitiesOnly yes
IdentityFile /Users/~/.ssh/github_private
↓のGitHubのプロフィールページのSSH and GPG keys → `New SSH key' ボタンをクリック。
pbcopy < ~/.ssh/github_private.pub
貼り付けたら Add SSH Key ボタンををクリックして完了
SSH接続テスト
ssh -T private.github.com
でOK
Hi [サブのユーザー名]! You've successfully authenticated, but GitHub does not provide shell access.
「Visual Studio Code Insiders」で
git@private.github.com/repository.gitを貼り付けてクローン
このスクラップは2024/08/06にクローズされました