Skip to content

Commit f2ab674

Browse files
authored
Update README.md
1 parent c19a43b commit f2ab674

File tree

1 file changed

+91
-26
lines changed

1 file changed

+91
-26
lines changed

README.md

Lines changed: 91 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,122 @@
1-
Git Worktree Extension for Visual Studio
1+
---
2+
3+
## Git Worktree Extension for Visual Studio
24

35
A lightweight extension to easily manage Git worktrees inside Visual Studio. Create, switch, and work on multiple branches without leaving your IDE.
46

5-
What it does:
7+
### What is git worktree?
8+
9+
Git worktree lets you check out multiple branches from the same Git repository at the same time, each into its own folder. You can work on different versions or features side by side, no more constant switching and rebuilding.
10+
11+
Instead of juggling one branch at a time, worktrees give each branch its own clean workspace. It’s like having multiple clones, but without wasting disk space or resyncing the whole repo.
12+
13+
This extension brings that power straight into Visual Studio. No command-line. No hassle.
14+
15+
---
16+
17+
## Why you need this extension?
18+
19+
Visual Studio’s Git support doesn’t handle multi-branch workflows well. This extension fixes that.
20+
21+
* No need for a separate Git client just to manage worktrees (Visual Studio already handles most Git features).
22+
* Other extensions (like Git Extensions) require installing their own Git client this doesn’t.
23+
* You **don’t even need Git installed on your PC** this uses Visual Studio’s inbuilt Git.
24+
25+
---
26+
27+
## What it does:
628

729
* Create new worktrees for any branch
830
* Switch between worktrees smoothly
931
* Manage multiple branches side-by-side
1032

11-
Why? Visual Studio’s Git support doesn’t handle multi-branch workflows well. This fixes that.
33+
---
34+
35+
## How to install:
36+
37+
Get it from the Visual Studio Marketplace, or build it from source.
38+
39+
---
1240

13-
How to install:
14-
Get it from the Visual Studio Marketplace or build from source.
41+
## Usage:
42+
43+
Open a solution or folder with a Git repository.
44+
**Note:** this extension only works if there’s an active Git repo or solution open otherwise, it won’t show up.
1545

16-
Usage:
1746
After installation, two options appear under **Git > Git Worktree**:
1847

1948
![image](https://github.com/user-attachments/assets/158b87d3-b6a0-4137-bb1d-0c15831db435)
2049

50+
* **Create Worktree** (`Ctrl+Shift+=`)
51+
* **Manage Worktrees** (`Ctrl+Shift+\\`)
2152

22-
* **Create Worktree** (Ctrl+Shift+=)
23-
* **Manage Worktrees** (Ctrl+Shift+)
53+
---
2454

25-
**Create Worktree Window:**
55+
### **Create Worktree Window:**
2656

27-
![image](https://github.com/user-attachments/assets/105abd78-32bb-456d-9024-58c2152766d4)
57+
![image](https://github.com/user-attachments/assets/e8186e83-9a7f-498e-ad3b-e92b44fc7447)
2858

2959
1. Shows current repo
30-
2. Choose branch from a list (branches with a "+" prefix are active worktrees)
31-
3. Set path for new worktree
32-
4. Force create option (overwrites overlapping worktrees)
33-
5. Option to open the new worktree in a new Visual Studio window (works if “Load” is enabled in settings)
34-
6. Creates new Worktree for selected branch in selected path
60+
2. Choose branch from the dropdown
61+
62+
* You can also type to filter it will suggest relevant matches
63+
* It lists all branches in the repo
64+
* Branches with a "+" prefix already have a worktree
65+
3. Set path for the new worktree
66+
67+
* By default, the path will be:
68+
`repo path/repo_name_worktree/branch_name`
69+
* Worktree name = branch name
70+
* You can choose your own directory
71+
* You can also set a default base directory in **Settings** (explained later)
72+
4. **Force create**: overwrites existing/overlapping worktrees
73+
5. Option to **open the new worktree in a new Visual Studio window** (only works if “Load” is enabled in settings)
74+
6. Creates the worktree for the selected branch at the selected path
75+
76+
---
3577

36-
**Manage Worktrees Window:**
78+
### **Manage Worktrees Window:**
3779

38-
![image](https://github.com/user-attachments/assets/178b9b63-61c3-47e8-a2b7-72f80a3372cb)
80+
![image](https://github.com/user-attachments/assets/087ff258-f3c6-4120-a048-23ecbdd5e81c)
3981

4082
1. Shows current repo
41-
2. List of all created worktrees
42-
3. Option to open the selected worktree in a new Visual Studio window
83+
2. Lists all created worktrees (with their paths)
84+
3. Option to open the selected worktree in a new VS window
4385
4. Open selected worktree
44-
5. Force remove (even if uncommitted changes exist)
45-
6. Prune dangling worktree references
86+
5. **Force remove** (even if there are uncommitted changes)
87+
6. **Prune** dangling worktree references
88+
89+
* Sometimes when you delete a worktree manually, Git still holds a reference
90+
* Pruning removes that, so Git allows creating worktree again for that branch
4691
7. Remove selected worktree
4792

48-
**Settings:**
93+
---
94+
95+
### **Output Window:**
96+
97+
All Git command executions performed by the extension are logged in Visual Studio’s Output pane (under Git Worktree), and key status updates also appear in the status bar at the bottom for quick feedback.
4998

50-
![image](https://github.com/user-attachments/assets/008a34af-1337-4fef-ab34-b91d54249867)
99+
![image](https://github.com/user-attachments/assets/06c97844-1709-42f4-9658-bfc50914be05)
100+
101+
---
102+
103+
### **Settings:**
104+
105+
![image](https://github.com/user-attachments/assets/db5bab93-cc87-48a1-a46c-b979c7968774)
51106

52107
Accessible via **Git > Settings > Source Control > Git Worktree**
53108

54-
* **Default branch path:** If empty, defaults to `repo path\<repo>_worktree\<branch>`, else user-defined path
55-
* **Load:** If enabled, opens new worktree in a new window after creation (enables the checkbox in create window)
109+
* **Default Worktree Directory**:
110+
111+
* If empty, defaults to:
112+
`repo directory\repo_name_worktree\branch_name`
113+
* Otherwise, uses your custom directory
114+
* **Load**:
115+
116+
* If True: opens new worktree in a new window after creation
117+
* If False: it just creates the worktree but doesn’t open it
118+
Useful if you want to prepare worktrees but open them later
119+
120+
---
56121

57-
This keeps your multi-branch Git workflow smooth and integrated, right inside Visual Studio.
122+
This keeps your multi-branch Git workflow clean and fully integrated without leaving Visual Studio.

0 commit comments

Comments
 (0)