Skip to content

Commit de65ecb

Browse files
committed
Help tips around git worktree one of git 2.5 features
1 parent 328e594 commit de65ecb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
* [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files)
4040
* [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files)
4141
* [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files)
42+
* [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25)
43+
* [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state)
4244

4345
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
4446
<!-- @doxie.inject end toc -->
@@ -257,5 +259,15 @@ git ls-files --others
257259
git ls-files --others -i --exclude-standard
258260
```
259261

262+
## Create new working tree from a repository (git 2.5)
263+
```sh
264+
git worktree add -b <branch-name> <path> <start-point>
265+
```
266+
267+
## Create new working tree from HEAD state
268+
```sh
269+
git worktree add --detach <path> HEAD
270+
```
271+
260272
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
261273
<!-- @doxie.inject end -->

tips.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,13 @@
147147
{
148148
"title": "Show all ignored files",
149149
"tip": "git ls-files --others -i --exclude-standard"
150+
},
151+
{
152+
"title": "Create new working tree from a repository (git 2.5)",
153+
"tip":"git worktree add -b <branch-name> <path> <start-point>"
154+
},
155+
{
156+
"title": "Create new working tree from HEAD state",
157+
"tip": "git worktree add --detach <path> HEAD"
150158
}
151159
]

0 commit comments

Comments
 (0)