<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-worktree.txt, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-03-14T19:01:05Z</updated>
<entry>
<title>Merge branch 'nd/worktree-move'</title>
<updated>2018-03-14T19:01:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-14T19:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd0f794342d5b3921f2d5d4bffce87ec7b7e4d96'/>
<id>urn:sha1:bd0f794342d5b3921f2d5d4bffce87ec7b7e4d96</id>
<content type='text'>
"git worktree" learned move and remove subcommands.

* nd/worktree-move:
  t2028: fix minor error and issues in newly-added "worktree move" tests
  worktree remove: allow it when $GIT_WORK_TREE is already gone
  worktree remove: new command
  worktree move: refuse to move worktrees with submodules
  worktree move: accept destination as directory
  worktree move: new command
  worktree.c: add update_worktree_location()
  worktree.c: add validate_worktree()
</content>
</entry>
<entry>
<title>git-worktree.txt: fix indentation of example and text of 'add' command</title>
<updated>2018-02-16T21:12:27Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-02-16T20:44:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d023df1ee6fac80897aebe99cdefe7ec82067ce2'/>
<id>urn:sha1:d023df1ee6fac80897aebe99cdefe7ec82067ce2</id>
<content type='text'>
When 4e85333197 (worktree: make add &lt;path&gt; &lt;branch&gt; dwim, 2017-11-26)
added an example command in a literal code block, it neglected to
insert a mandatory "+" line before the block. This omission resulted
in both the literal code block and the (existing) paragraph following
the block to be outdented, even though they should be indented under
the 'add' sub-command along with the rest of the text pertaining to
that command. Furthermore, the mandatory "+" line separating the code
block from the following text got rendered as a leading character on
the line ("+ If &lt;commit-ish&gt;...") rather than being treated as a
formatting directive.

Fix these problems by adding the missing "+" line before the example
code block.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-worktree.txt: fix missing ")" typo</title>
<updated>2018-02-16T21:11:40Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-02-16T20:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=661a5a382e37c8a81e76ba803559075f3350a51c'/>
<id>urn:sha1:661a5a382e37c8a81e76ba803559075f3350a51c</id>
<content type='text'>
Add the closing ")" to a parenthetical phrase introduced by 4e85333197
(worktree: make add &lt;path&gt; &lt;branch&gt; dwim, 2017-11-26).

While at it, add a missing ":" at the end of the same sentence since
it precedes an example literal command block.

Reported-by: Mike Nordell &lt;tamlin.thefirst@gmail.com&gt;
Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree remove: new command</title>
<updated>2018-02-12T21:13:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-12T09:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc73385cf6c5c229458775bc92e7dbbe24d11611'/>
<id>urn:sha1:cc73385cf6c5c229458775bc92e7dbbe24d11611</id>
<content type='text'>
This command allows to delete a worktree. Like 'move' you cannot
remove the main worktree, or one with submodules inside [1].

For deleting $GIT_WORK_TREE, Untracked files or any staged entries are
considered precious and therefore prevent removal by default. Ignored
files are not precious.

When it comes to deleting $GIT_DIR, there's no "clean" check because
there should not be any valuable data in there, except:

- HEAD reflog. There is nothing we can do about this until somebody
  steps up and implements the ref graveyard.

- Detached HEAD. Technically it can still be recovered. Although it
  may be nice to warn about orphan commits like 'git checkout' does.

[1] We do 'git status' with --ignore-submodules=all for safety
    anyway. But this needs a closer look by submodule people before we
    can allow deletion. For example, if a submodule is totally clean,
    but its repo not absorbed to the main .git dir, then deleting
    worktree also deletes the valuable .submodule repo too.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree move: refuse to move worktrees with submodules</title>
<updated>2018-02-12T21:13:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-12T09:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78d986b252359351a579dc2629c8384d5c8eb8ff'/>
<id>urn:sha1:78d986b252359351a579dc2629c8384d5c8eb8ff</id>
<content type='text'>
Submodules contains .git files with relative paths. After a worktree
move, these files need to be updated or they may point to nowhere.

This is a bandage patch to make sure "worktree move" don't break
people's worktrees by accident. When .git file update code is in
place, this validate_no_submodules() could be removed.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree move: new command</title>
<updated>2018-02-12T21:13:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-12T09:49:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f792bb4721066ce27ee98c4ad38d6d146b64fcf'/>
<id>urn:sha1:9f792bb4721066ce27ee98c4ad38d6d146b64fcf</id>
<content type='text'>
This command allows to relocate linked worktrees. Main worktree cannot
(yet) be moved.

There are two options to move the main worktree, but both have
complications, so it's not implemented yet. Anyway the options are:

- convert the main worktree to a linked one and move it away, leave
  the git repository where it is. The repo essentially becomes bare
  after this move.

- move the repository with the main worktree. The tricky part is make
  sure all file descriptors to the repository are closed, or it may
  fail on Windows.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Documentation/git-worktree.txt: add missing `</title>
<updated>2018-01-11T20:19:40Z</updated>
<author>
<name>Ralf Thielow</name>
<email>ralf.thielow@gmail.com</email>
</author>
<published>2018-01-11T18:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50fdf7b1b12c801ded04c31c108ece9a9570a9ec'/>
<id>urn:sha1:50fdf7b1b12c801ded04c31c108ece9a9570a9ec</id>
<content type='text'>
Signed-off-by: Ralf Thielow &lt;ralf.thielow@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add worktree.guessRemote config option</title>
<updated>2017-12-06T17:47:35Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-11-29T20:04:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e92445a73173cf21a11b8e79cb7be16485deec69'/>
<id>urn:sha1:e92445a73173cf21a11b8e79cb7be16485deec69</id>
<content type='text'>
Some users might want to have the --guess-remote option introduced in
the previous commit on by default, so they don't have to type it out
every time they create a new worktree.

Add a config option worktree.guessRemote that allows users to configure
the default behaviour for themselves.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add --guess-remote flag to add subcommand</title>
<updated>2017-12-06T17:47:35Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-11-29T20:04:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71d6682d8ca9870cbe457cf55c83402c33b41030'/>
<id>urn:sha1:71d6682d8ca9870cbe457cf55c83402c33b41030</id>
<content type='text'>
Currently 'git worktree add &lt;path&gt;' creates a new branch named after the
basename of the &lt;path&gt;, that matches the HEAD of whichever worktree we
were on when calling "git worktree add &lt;path&gt;".

It's sometimes useful to have 'git worktree add &lt;path&gt; behave more like
the dwim machinery in 'git checkout &lt;new-branch&gt;', i.e. check if the new
branch name, derived from the basename of the &lt;path&gt;, uniquely matches
the branch name of a remote-tracking branch, and if so check out that
branch and set the upstream to the remote-tracking branch.

Add a new --guess-remote option that enables exactly that behaviour.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: make add &lt;path&gt; &lt;branch&gt; dwim</title>
<updated>2017-11-27T00:48:06Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-11-26T19:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4e8533319760c1e9255c56c2059c721286dc8dab'/>
<id>urn:sha1:4e8533319760c1e9255c56c2059c721286dc8dab</id>
<content type='text'>
Currently 'git worktree add &lt;path&gt; &lt;branch&gt;', errors out when 'branch'
is not a local branch.  It has no additional dwim'ing features that one
might expect.

Make it behave more like 'git checkout &lt;branch&gt;' when the branch doesn't
exist locally, but a remote tracking branch uniquely matches the desired
branch name, i.e. create a new branch from the remote tracking branch
and set the upstream to the remote tracking branch.

As 'git worktree add' currently just dies in this situation, there are
no backwards compatibility worries when introducing this feature.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
