[{"data":1,"prerenderedAt":1009},["ShallowReactive",2],{"blog-/blog/comprehensive-guide-to-git-worktrees":3,"related-posts-/blog/comprehensive-guide-to-git-worktrees":1008},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"image":11,"categories":12,"author":16,"readingTime":17,"body":18,"_type":1002,"_id":1003,"_source":1004,"_file":1005,"_stem":1006,"_extension":1007},"/blog/comprehensive-guide-to-git-worktrees","blog",false,"","Comprehensive Guide to Git Worktrees","This document provides a technical and conceptual breakdown of Git Worktrees, ranging from basic multi-directory management to high-velocity professional workflows.","2026-02-18","/images/blog/git-worktrees.jpg",[13,14,15],"git","productivity","workflow","Ayush Jaipuriar","10 min read",{"type":19,"children":20,"toc":982},"root",[21,30,60,77,84,144,150,155,207,213,218,291,297,302,335,341,347,483,489,497,539,544,552,608,613,619,624,630,773,779,787,793,816,857,865,889,907,913,976],{"type":22,"tag":23,"props":24,"children":26},"element","h2",{"id":25},"_1-the-core-philosophy",[27],{"type":28,"value":29},"text","1. The Core Philosophy",{"type":22,"tag":31,"props":32,"children":33},"p",{},[34,36,42,44,49,51,58],{"type":28,"value":35},"In a standard Git setup, you have one ",{"type":22,"tag":37,"props":38,"children":39},"strong",{},[40],{"type":28,"value":41},"Working Directory",{"type":28,"value":43}," (your files) and one ",{"type":22,"tag":37,"props":45,"children":46},{},[47],{"type":28,"value":48},"Repository",{"type":28,"value":50}," (the ",{"type":22,"tag":52,"props":53,"children":55},"code",{"className":54},[],[56],{"type":28,"value":57},".git",{"type":28,"value":59}," folder). Switching branches requires \"flipping pages\" in that single folder. When you change branches, Git physically swaps the files on your disk to match the target branch.",{"type":22,"tag":31,"props":61,"children":62},{},[63,68,70,75],{"type":22,"tag":37,"props":64,"children":65},{},[66],{"type":28,"value":67},"Git Worktrees",{"type":28,"value":69}," decouple the working directory from the repository. They allow you to have one single \"Brain\" (the ",{"type":22,"tag":52,"props":71,"children":73},{"className":72},[],[74],{"type":28,"value":57},{"type":28,"value":76}," database) connected to multiple \"Bodies\" (folders), each showing a different branch simultaneously. This is not a copy of the repository; it is a live, linked view of a specific branch.",{"type":22,"tag":78,"props":79,"children":81},"h3",{"id":80},"key-benefits",[82],{"type":28,"value":83},"Key Benefits",{"type":22,"tag":85,"props":86,"children":87},"ul",{},[88,107,117,127],{"type":22,"tag":89,"props":90,"children":91},"li",{},[92,97,99,105],{"type":22,"tag":37,"props":93,"children":94},{},[95],{"type":28,"value":96},"Zero-Stash Context Switching:",{"type":28,"value":98}," Move to an urgent hotfix without the overhead of ",{"type":22,"tag":52,"props":100,"children":102},{"className":101},[],[103],{"type":28,"value":104},"git stash",{"type":28,"value":106}," or creating \"work-in-progress\" (WIP) commits. You simply change directories.",{"type":22,"tag":89,"props":108,"children":109},{},[110,115],{"type":22,"tag":37,"props":111,"children":112},{},[113],{"type":28,"value":114},"Parallel Execution:",{"type":28,"value":116}," Run a long-running test suite or a build process on the main branch in one terminal while continuing to write code for a new feature in another folder.",{"type":22,"tag":89,"props":118,"children":119},{},[120,125],{"type":22,"tag":37,"props":121,"children":122},{},[123],{"type":28,"value":124},"Side-by-Side Comparison:",{"type":28,"value":126}," Open two different branches in your IDE (e.g., VS Code or IntelliJ) simultaneously. This is invaluable for manual regression testing or verifying how a specific utility function evolved between versions.",{"type":22,"tag":89,"props":128,"children":129},{},[130,135,137,142],{"type":22,"tag":37,"props":131,"children":132},{},[133],{"type":28,"value":134},"Resource Efficiency:",{"type":28,"value":136}," Unlike cloning the repo multiple times (which duplicates the entire ",{"type":22,"tag":52,"props":138,"children":140},{"className":139},[],[141],{"type":28,"value":57},{"type":28,"value":143}," history, often hundreds of megabytes), worktrees share the same object database. The only extra space used is for the actual checked-out source files.",{"type":22,"tag":23,"props":145,"children":147},{"id":146},"_2-technical-architecture-the-brain-vs-the-body",[148],{"type":28,"value":149},"2. Technical Architecture: The \"Brain\" vs. The \"Body\"",{"type":22,"tag":31,"props":151,"children":152},{},[153],{"type":28,"value":154},"Understanding the link between worktrees is crucial for mastering the workflow.",{"type":22,"tag":85,"props":156,"children":157},{},[158,175],{"type":22,"tag":89,"props":159,"children":160},{},[161,173],{"type":22,"tag":37,"props":162,"children":163},{},[164,166,171],{"type":28,"value":165},"The Brain (Main ",{"type":22,"tag":52,"props":167,"children":169},{"className":168},[],[170],{"type":28,"value":57},{"type":28,"value":172},"):",{"type":28,"value":174}," Located in your primary folder, this holds the entire history, every commit, every blob, and all remote-tracking refs.",{"type":22,"tag":89,"props":176,"children":177},{},[178,183,185,190,192,197,199,205],{"type":22,"tag":37,"props":179,"children":180},{},[181],{"type":28,"value":182},"The Body (Linked Worktree):",{"type":28,"value":184}," A folder containing the files for a specific branch. Inside, instead of a ",{"type":22,"tag":52,"props":186,"children":188},{"className":187},[],[189],{"type":28,"value":57},{"type":28,"value":191}," folder, there is a ",{"type":22,"tag":52,"props":193,"children":195},{"className":194},[],[196],{"type":28,"value":57},{"type":28,"value":198}," file. This file contains a text path that points Git back to the administrative metadata stored in the main repository's ",{"type":22,"tag":52,"props":200,"children":202},{"className":201},[],[203],{"type":28,"value":204},".git/worktrees/",{"type":28,"value":206}," directory.",{"type":22,"tag":78,"props":208,"children":210},{"id":209},"the-connection-logic",[211],{"type":28,"value":212},"The Connection Logic",{"type":22,"tag":31,"props":214,"children":215},{},[216],{"type":28,"value":217},"Because all worktrees share the same database:",{"type":22,"tag":85,"props":219,"children":220},{},[221,247,265],{"type":22,"tag":89,"props":222,"children":223},{},[224,229,231,237,239,245],{"type":22,"tag":37,"props":225,"children":226},{},[227],{"type":28,"value":228},"Shared Commits:",{"type":28,"value":230}," If you commit a bug fix in ",{"type":22,"tag":52,"props":232,"children":234},{"className":233},[],[235],{"type":28,"value":236},"Worktree_B",{"type":28,"value":238},", that commit object is immediately available in ",{"type":22,"tag":52,"props":240,"children":242},{"className":241},[],[243],{"type":28,"value":244},"Worktree_A",{"type":28,"value":246},". You don't need to push or pull; the \"Brain\" already knows about it.",{"type":22,"tag":89,"props":248,"children":249},{},[250,255,257,263],{"type":22,"tag":37,"props":251,"children":252},{},[253],{"type":28,"value":254},"Universal Branch List:",{"type":28,"value":256}," Creating a branch in one folder makes it visible across all folders. Running ",{"type":22,"tag":52,"props":258,"children":260},{"className":259},[],[261],{"type":28,"value":262},"git branch",{"type":28,"value":264}," in any worktree shows the same list of local branches.",{"type":22,"tag":89,"props":266,"children":267},{},[268,273,275,281,283,289],{"type":22,"tag":37,"props":269,"children":270},{},[271],{"type":28,"value":272},"Unified Remote Updates:",{"type":28,"value":274}," Running ",{"type":22,"tag":52,"props":276,"children":278},{"className":277},[],[279],{"type":28,"value":280},"git fetch",{"type":28,"value":282}," or ",{"type":22,"tag":52,"props":284,"children":286},{"className":285},[],[287],{"type":28,"value":288},"git pull",{"type":28,"value":290}," from a remote (e.g., origin) in one worktree updates the shared database. All other worktrees instantly see the new remote commits.",{"type":22,"tag":23,"props":292,"children":294},{"id":293},"_3-worktree-vs-stashing-when-to-use-which",[295],{"type":28,"value":296},"3. Worktree vs. Stashing: When to Use Which?",{"type":22,"tag":31,"props":298,"children":299},{},[300],{"type":28,"value":301},"While both tools help with context switching, they serve different purposes:",{"type":22,"tag":85,"props":303,"children":304},{},[305,320],{"type":22,"tag":89,"props":306,"children":307},{},[308,318],{"type":22,"tag":37,"props":309,"children":310},{},[311,313],{"type":28,"value":312},"Use ",{"type":22,"tag":52,"props":314,"children":316},{"className":315},[],[317],{"type":28,"value":104},{"type":28,"value":319}," for very minor interruptions (e.g., \"I need to check one line of code on another branch and come right back\"). It is faster for 30-second tasks.",{"type":22,"tag":89,"props":321,"children":322},{},[323,333],{"type":22,"tag":37,"props":324,"children":325},{},[326,327],{"type":28,"value":312},{"type":22,"tag":52,"props":328,"children":330},{"className":329},[],[331],{"type":28,"value":332},"git worktree",{"type":28,"value":334}," for substantial interruptions (e.g., \"A bug was found in production and I need to fix it while my current 2-hour build is running\"). It allows you to keep your current workspace exactly as it is—open files, running debuggers, and terminal states—without any disruption.",{"type":22,"tag":23,"props":336,"children":338},{"id":337},"_4-essential-command-reference",[339],{"type":28,"value":340},"4. Essential Command Reference",{"type":22,"tag":78,"props":342,"children":344},{"id":343},"basic-operations",[345],{"type":28,"value":346},"Basic Operations",{"type":22,"tag":348,"props":349,"children":350},"table",{},[351,371],{"type":22,"tag":352,"props":353,"children":354},"thead",{},[355],{"type":22,"tag":356,"props":357,"children":358},"tr",{},[359,366],{"type":22,"tag":360,"props":361,"children":363},"th",{"align":362},"left",[364],{"type":28,"value":365},"Command",{"type":22,"tag":360,"props":367,"children":368},{"align":362},[369],{"type":28,"value":370},"Purpose",{"type":22,"tag":372,"props":373,"children":374},"tbody",{},[375,409,432,449,466],{"type":22,"tag":356,"props":376,"children":377},{},[378,388],{"type":22,"tag":379,"props":380,"children":381},"td",{"align":362},[382],{"type":22,"tag":52,"props":383,"children":385},{"className":384},[],[386],{"type":28,"value":387},"git worktree add \u003Cpath> \u003Cbranch>",{"type":22,"tag":379,"props":389,"children":390},{"align":362},[391,393,399,401,407],{"type":28,"value":392},"Creates a new folder at ",{"type":22,"tag":52,"props":394,"children":396},{"className":395},[],[397],{"type":28,"value":398},"\u003Cpath>",{"type":28,"value":400}," and checks out the existing ",{"type":22,"tag":52,"props":402,"children":404},{"className":403},[],[405],{"type":28,"value":406},"\u003Cbranch>",{"type":28,"value":408},".",{"type":22,"tag":356,"props":410,"children":411},{},[412,421],{"type":22,"tag":379,"props":413,"children":414},{"align":362},[415],{"type":22,"tag":52,"props":416,"children":418},{"className":417},[],[419],{"type":28,"value":420},"git worktree add -b \u003Cnew-branch> \u003Cpath>",{"type":22,"tag":379,"props":422,"children":423},{"align":362},[424,426,431],{"type":28,"value":425},"Creates a brand new branch and checks it out into a new folder at ",{"type":22,"tag":52,"props":427,"children":429},{"className":428},[],[430],{"type":28,"value":398},{"type":28,"value":408},{"type":22,"tag":356,"props":433,"children":434},{},[435,444],{"type":22,"tag":379,"props":436,"children":437},{"align":362},[438],{"type":22,"tag":52,"props":439,"children":441},{"className":440},[],[442],{"type":28,"value":443},"git worktree list",{"type":22,"tag":379,"props":445,"children":446},{"align":362},[447],{"type":28,"value":448},"Displays a table of all active worktrees, their file paths, and active branches.",{"type":22,"tag":356,"props":450,"children":451},{},[452,461],{"type":22,"tag":379,"props":453,"children":454},{"align":362},[455],{"type":22,"tag":52,"props":456,"children":458},{"className":457},[],[459],{"type":28,"value":460},"git worktree remove \u003Cpath>",{"type":22,"tag":379,"props":462,"children":463},{"align":362},[464],{"type":28,"value":465},"Deletes the worktree folder and tells the \"Brain\" to stop tracking it.",{"type":22,"tag":356,"props":467,"children":468},{},[469,478],{"type":22,"tag":379,"props":470,"children":471},{"align":362},[472],{"type":22,"tag":52,"props":473,"children":475},{"className":474},[],[476],{"type":28,"value":477},"git worktree prune",{"type":22,"tag":379,"props":479,"children":480},{"align":362},[481],{"type":28,"value":482},"Cleans up \"ghost\" references if you deleted a folder via the OS instead of the CLI.",{"type":22,"tag":78,"props":484,"children":486},{"id":485},"advanced-operations",[487],{"type":28,"value":488},"Advanced Operations",{"type":22,"tag":31,"props":490,"children":491},{},[492],{"type":22,"tag":37,"props":493,"children":494},{},[495],{"type":28,"value":496},"Checking out Remote Branches:",{"type":22,"tag":498,"props":499,"children":503},"pre",{"code":500,"language":501,"meta":7,"className":502,"style":7},"git worktree add ../fix-folder origin/hotfix-api\n","bash","language-bash shiki shiki-themes github-light github-dark",[504],{"type":22,"tag":52,"props":505,"children":506},{"__ignoreMap":7},[507],{"type":22,"tag":508,"props":509,"children":512},"span",{"class":510,"line":511},"line",1,[513,518,524,529,534],{"type":22,"tag":508,"props":514,"children":516},{"style":515},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[517],{"type":28,"value":13},{"type":22,"tag":508,"props":519,"children":521},{"style":520},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[522],{"type":28,"value":523}," worktree",{"type":22,"tag":508,"props":525,"children":526},{"style":520},[527],{"type":28,"value":528}," add",{"type":22,"tag":508,"props":530,"children":531},{"style":520},[532],{"type":28,"value":533}," ../fix-folder",{"type":22,"tag":508,"props":535,"children":536},{"style":520},[537],{"type":28,"value":538}," origin/hotfix-api\n",{"type":22,"tag":31,"props":540,"children":541},{},[542],{"type":28,"value":543},"This creates a local branch tracking the remote one and places it in a separate directory.",{"type":22,"tag":31,"props":545,"children":546},{},[547],{"type":22,"tag":37,"props":548,"children":549},{},[550],{"type":28,"value":551},"Locking a Worktree:",{"type":22,"tag":498,"props":553,"children":555},{"code":554,"language":501,"meta":7,"className":502,"style":7},"git worktree lock \u003Cpath> --reason \"On external drive\"\n",[556],{"type":22,"tag":52,"props":557,"children":558},{"__ignoreMap":7},[559],{"type":22,"tag":508,"props":560,"children":561},{"class":510,"line":511},[562,566,570,575,581,586,592,597,603],{"type":22,"tag":508,"props":563,"children":564},{"style":515},[565],{"type":28,"value":13},{"type":22,"tag":508,"props":567,"children":568},{"style":520},[569],{"type":28,"value":523},{"type":22,"tag":508,"props":571,"children":572},{"style":520},[573],{"type":28,"value":574}," lock",{"type":22,"tag":508,"props":576,"children":578},{"style":577},"--shiki-default:#D73A49;--shiki-dark:#F97583",[579],{"type":28,"value":580}," \u003C",{"type":22,"tag":508,"props":582,"children":583},{"style":520},[584],{"type":28,"value":585},"pat",{"type":22,"tag":508,"props":587,"children":589},{"style":588},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[590],{"type":28,"value":591},"h",{"type":22,"tag":508,"props":593,"children":594},{"style":577},[595],{"type":28,"value":596},">",{"type":22,"tag":508,"props":598,"children":600},{"style":599},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[601],{"type":28,"value":602}," --reason",{"type":22,"tag":508,"props":604,"children":605},{"style":520},[606],{"type":28,"value":607}," \"On external drive\"\n",{"type":22,"tag":31,"props":609,"children":610},{},[611],{"type":28,"value":612},"Use this if your worktree is on a USB drive or network share. It prevents Git from accidentally pruning the metadata if the drive is disconnected.",{"type":22,"tag":23,"props":614,"children":616},{"id":615},"_5-the-bare-professional-workflow",[617],{"type":28,"value":618},"5. The \"Bare\" Professional Workflow",{"type":22,"tag":31,"props":620,"children":621},{},[622],{"type":28,"value":623},"In high-velocity environments, developers often use a \"Bare\" clone. This setup ensures that no branch is \"special\" and every branch (including main) lives in its own dedicated worktree.",{"type":22,"tag":78,"props":625,"children":627},{"id":626},"setup-steps",[628],{"type":28,"value":629},"Setup Steps",{"type":22,"tag":631,"props":632,"children":633},"ol",{},[634,678,717],{"type":22,"tag":89,"props":635,"children":636},{},[637,642,644],{"type":22,"tag":37,"props":638,"children":639},{},[640],{"type":28,"value":641},"Clone as Bare:",{"type":28,"value":643}," Initialize the \"Brain\" without an attached working directory.",{"type":22,"tag":498,"props":645,"children":647},{"code":646,"language":501,"meta":7,"className":502,"style":7},"git clone --bare https://github.com/user/repo.git .git\n",[648],{"type":22,"tag":52,"props":649,"children":650},{"__ignoreMap":7},[651],{"type":22,"tag":508,"props":652,"children":653},{"class":510,"line":511},[654,658,663,668,673],{"type":22,"tag":508,"props":655,"children":656},{"style":515},[657],{"type":28,"value":13},{"type":22,"tag":508,"props":659,"children":660},{"style":520},[661],{"type":28,"value":662}," clone",{"type":22,"tag":508,"props":664,"children":665},{"style":599},[666],{"type":28,"value":667}," --bare",{"type":22,"tag":508,"props":669,"children":670},{"style":520},[671],{"type":28,"value":672}," https://github.com/user/repo.git",{"type":22,"tag":508,"props":674,"children":675},{"style":520},[676],{"type":28,"value":677}," .git\n",{"type":22,"tag":89,"props":679,"children":680},{},[681,686,688],{"type":22,"tag":37,"props":682,"children":683},{},[684],{"type":28,"value":685},"Configure Config:",{"type":28,"value":687}," (Optional) Tell Git that this is actually a repository core.",{"type":22,"tag":498,"props":689,"children":691},{"code":690,"language":501,"meta":7,"className":502,"style":7},"git config core.bare false\n",[692],{"type":22,"tag":52,"props":693,"children":694},{"__ignoreMap":7},[695],{"type":22,"tag":508,"props":696,"children":697},{"class":510,"line":511},[698,702,707,712],{"type":22,"tag":508,"props":699,"children":700},{"style":515},[701],{"type":28,"value":13},{"type":22,"tag":508,"props":703,"children":704},{"style":520},[705],{"type":28,"value":706}," config",{"type":22,"tag":508,"props":708,"children":709},{"style":520},[710],{"type":28,"value":711}," core.bare",{"type":22,"tag":508,"props":713,"children":714},{"style":599},[715],{"type":28,"value":716}," false\n",{"type":22,"tag":89,"props":718,"children":719},{},[720,725],{"type":22,"tag":37,"props":721,"children":722},{},[723],{"type":28,"value":724},"Add Your Primary Branches:",{"type":22,"tag":498,"props":726,"children":728},{"code":727,"language":501,"meta":7,"className":502,"style":7},"git worktree add main\ngit worktree add develop\n",[729],{"type":22,"tag":52,"props":730,"children":731},{"__ignoreMap":7},[732,752],{"type":22,"tag":508,"props":733,"children":734},{"class":510,"line":511},[735,739,743,747],{"type":22,"tag":508,"props":736,"children":737},{"style":515},[738],{"type":28,"value":13},{"type":22,"tag":508,"props":740,"children":741},{"style":520},[742],{"type":28,"value":523},{"type":22,"tag":508,"props":744,"children":745},{"style":520},[746],{"type":28,"value":528},{"type":22,"tag":508,"props":748,"children":749},{"style":520},[750],{"type":28,"value":751}," main\n",{"type":22,"tag":508,"props":753,"children":755},{"class":510,"line":754},2,[756,760,764,768],{"type":22,"tag":508,"props":757,"children":758},{"style":515},[759],{"type":28,"value":13},{"type":22,"tag":508,"props":761,"children":762},{"style":520},[763],{"type":28,"value":523},{"type":22,"tag":508,"props":765,"children":766},{"style":520},[767],{"type":28,"value":528},{"type":22,"tag":508,"props":769,"children":770},{"style":520},[771],{"type":28,"value":772}," develop\n",{"type":22,"tag":78,"props":774,"children":776},{"id":775},"resulting-structure",[777],{"type":28,"value":778},"Resulting Structure",{"type":22,"tag":498,"props":780,"children":782},{"code":781},"my-project/\n├── .git/          # The central \"Brain\" (now a hidden folder in the root)\n├── main/          # Production workspace\n├── develop/       # Active development workspace\n└── feature-abc/   # Temporary feature workspace\n",[783],{"type":22,"tag":52,"props":784,"children":785},{"__ignoreMap":7},[786],{"type":28,"value":781},{"type":22,"tag":23,"props":788,"children":790},{"id":789},"_6-critical-constraints-safety-rules",[791],{"type":28,"value":792},"6. Critical Constraints & Safety Rules",{"type":22,"tag":85,"props":794,"children":795},{},[796,806],{"type":22,"tag":89,"props":797,"children":798},{},[799,804],{"type":22,"tag":37,"props":800,"children":801},{},[802],{"type":28,"value":803},"The Single Branch Guard:",{"type":28,"value":805}," Git strictly forbids checking out the same branch in two different worktrees. This is a safety feature to prevent \"race conditions\" where two different folders try to update the same branch pointer to different commits.",{"type":22,"tag":89,"props":807,"children":808},{},[809,814],{"type":22,"tag":37,"props":810,"children":811},{},[812],{"type":28,"value":813},"The \"Merge\" Logic:",{"type":28,"value":815}," Remember: Branches contain code; Folders contain files. You always merge by branch name.",{"type":22,"tag":31,"props":817,"children":818},{},[819,824,826,832,834,840,842,848,849,855],{"type":22,"tag":37,"props":820,"children":821},{},[822],{"type":28,"value":823},"Scenario:",{"type":28,"value":825}," You are in ",{"type":22,"tag":52,"props":827,"children":829},{"className":828},[],[830],{"type":28,"value":831},"Folder_A",{"type":28,"value":833}," (on ",{"type":22,"tag":52,"props":835,"children":837},{"className":836},[],[838],{"type":28,"value":839},"main",{"type":28,"value":841},") and want changes from ",{"type":22,"tag":52,"props":843,"children":845},{"className":844},[],[846],{"type":28,"value":847},"Folder_B",{"type":28,"value":833},{"type":22,"tag":52,"props":850,"children":852},{"className":851},[],[853],{"type":28,"value":854},"feature-login",{"type":28,"value":856},").",{"type":22,"tag":31,"props":858,"children":859},{},[860],{"type":22,"tag":37,"props":861,"children":862},{},[863],{"type":28,"value":864},"Correct:",{"type":22,"tag":498,"props":866,"children":868},{"code":867,"language":501,"meta":7,"className":502,"style":7},"git merge feature-login\n",[869],{"type":22,"tag":52,"props":870,"children":871},{"__ignoreMap":7},[872],{"type":22,"tag":508,"props":873,"children":874},{"class":510,"line":511},[875,879,884],{"type":22,"tag":508,"props":876,"children":877},{"style":515},[878],{"type":28,"value":13},{"type":22,"tag":508,"props":880,"children":881},{"style":520},[882],{"type":28,"value":883}," merge",{"type":22,"tag":508,"props":885,"children":886},{"style":520},[887],{"type":28,"value":888}," feature-login\n",{"type":22,"tag":31,"props":890,"children":891},{},[892,897,899,905],{"type":22,"tag":37,"props":893,"children":894},{},[895],{"type":28,"value":896},"Note:",{"type":28,"value":898}," You do not need to ",{"type":22,"tag":52,"props":900,"children":902},{"className":901},[],[903],{"type":28,"value":904},"cd",{"type":28,"value":906}," into the other folder to \"send\" the code; you simply \"pull\" the branch name from the shared database.",{"type":22,"tag":23,"props":908,"children":910},{"id":909},"_7-common-troubleshooting-best-practices",[911],{"type":28,"value":912},"7. Common Troubleshooting & Best Practices",{"type":22,"tag":85,"props":914,"children":915},{},[916,941,958],{"type":22,"tag":89,"props":917,"children":918},{},[919,924,926,932,934,939],{"type":22,"tag":37,"props":920,"children":921},{},[922],{"type":28,"value":923},"The \"Already Checked Out\" Error:",{"type":28,"value":925}," If you see ",{"type":22,"tag":52,"props":927,"children":929},{"className":928},[],[930],{"type":28,"value":931},"fatal: 'my-branch' is already checked out at '...'",{"type":28,"value":933},", it means that branch is tied to another folder. You must either ",{"type":22,"tag":52,"props":935,"children":937},{"className":936},[],[938],{"type":28,"value":904},{"type":28,"value":940}," to that folder or move that worktree to a different branch before you can use it elsewhere.",{"type":22,"tag":89,"props":942,"children":943},{},[944,949,951,956],{"type":22,"tag":37,"props":945,"children":946},{},[947],{"type":28,"value":948},"Manual Deletion Cleanup:",{"type":28,"value":950}," If you accidentally delete a worktree folder using the \"Trash\" or \"Delete\" key in your File Explorer, Git will still think the branch is \"busy.\" Always run ",{"type":22,"tag":52,"props":952,"children":954},{"className":953},[],[955],{"type":28,"value":477},{"type":28,"value":957}," to refresh Git's internal map of your file system.",{"type":22,"tag":89,"props":959,"children":960},{},[961,966,968,974],{"type":22,"tag":37,"props":962,"children":963},{},[964],{"type":28,"value":965},"Relative Paths:",{"type":28,"value":967}," When adding worktrees, using ",{"type":22,"tag":52,"props":969,"children":971},{"className":970},[],[972],{"type":28,"value":973},"../folder-name",{"type":28,"value":975}," is generally safer as it keeps the worktrees as \"siblings\" rather than nesting a repository inside a repository.",{"type":22,"tag":977,"props":978,"children":979},"style",{},[980],{"type":28,"value":981},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":754,"depth":754,"links":983},[984,988,991,992,996,1000,1001],{"id":25,"depth":754,"text":29,"children":985},[986],{"id":80,"depth":987,"text":83},3,{"id":146,"depth":754,"text":149,"children":989},[990],{"id":209,"depth":987,"text":212},{"id":293,"depth":754,"text":296},{"id":337,"depth":754,"text":340,"children":993},[994,995],{"id":343,"depth":987,"text":346},{"id":485,"depth":987,"text":488},{"id":615,"depth":754,"text":618,"children":997},[998,999],{"id":626,"depth":987,"text":629},{"id":775,"depth":987,"text":778},{"id":789,"depth":754,"text":792},{"id":909,"depth":754,"text":912},"markdown","content:blog:2.comprehensive-guide-to-git-worktrees.md","content","blog/2.comprehensive-guide-to-git-worktrees.md","blog/2.comprehensive-guide-to-git-worktrees","md",[],1776575850648]