naopoyo.com
  • Docs
  • Tags
  • Bookmarks
  • Tools
  • About
  • Docs
  • Tags
  • Bookmarks
  • Tools
  • About

目次

© naopoyo

🐩

開発日記-2025-11-02 / git worktree について調べる

公開日
約16時間前
2025-11-02
更新履歴
GitHubで見る
  • 開発日記

git worktree について調べる

  • devcontainer を使ってると色々と面倒なので今後も調べて楽な方法を探す

worktree 追加

Terminal
git worktree add ../folder-name

worktree 削除

Terminal
git worktree remove ../folder-name

worktree 一覧

Terminal
git worktree list

devcontainer で git worktree

  • worktree の .git はファイルになる
  • このファイルに記載されたパスの大元の .git が見つけられないと GIT の操作とかができない
  • devcontainer 上の worktree はマウントしないと見つけられない
docker-compose.override.yml
version: "3"

name: "project-worktree"

services:
  client_workspace:
    volumes:
      - ../../project/.git:/var/project/.git:cached
.git
gitdir: ../project/.git/worktrees/worktree

ブックマーク

Dev Container でも Git Worktree で快適に開発したい
zenn.dev favicon
zenn.dev
Dev Container でも Git Worktree で快適に開発したい
Git Worktreeをわかりやすく解説
zenn.dev favicon
zenn.dev
Git Worktreeをわかりやすく解説
git worktreeで作った環境でDev Containerを使う時にgitを使えるようにする - Qiita
git worktreeで作られたリンクワークツリー(子リポジトリ)をそのままDev Containerで起動するようにすると、コンテナ内でgitがうまく動作せず変更差分を見たりできません。 これはコンテナ内にメインワークツリー(親リポジトリ)が無いのが原因です。.git ...
qiita.com favicon
qiita.com
git worktreeで作った環境でDev Containerを使う時にgitを使えるようにする - Qiita
DevContainerを勉強する
melted-soy-source.com favicon
melted-soy-source.com

目次

最近更新された記事

🌇
開発日記-2025-10-31 / Xのブックマークに入れてたサイトを読む
3日前 - 2025年10月31日
  • 開発日記
🛷
開発日記-2025-10-29 / tocbot のオプション
5日前 - 2025年10月29日
  • 開発日記
  • tocbot
🚩
Next.js 16にアップグレードする
7日前 - 2025年10月27日
  • Next.js