all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: git: how to restore a deleted worktree?
Date: Thu, 04 Jan 2018 07:51:03 -0600	[thread overview]
Message-ID: <86wp0x3f7c.fsf@stephe-leake.org> (raw)

I have the emacs-26 branch checked out in a worktree created by :

cd emacs/master
git worktree add -b emacs-26 ../emacs-26 origin/emacs-26

At some point, that worktree was in a confusing state, so I deleted it,
intending to do a fresh checkout. So I repeated the above command, but
it complained "branch emacs-26 already exists". So I dropped the '-b
emacs-26', and the command seemed to work.

However, 'git status' in the new worktree says "not on any branch", 
'git push' complains about fast-forward, and 'git pull' says not on a
branch.

How do I fix this?

-- 
-- Stephe



             reply	other threads:[~2018-01-04 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 13:51 Stephen Leake [this message]
2018-01-04 14:06 ` git: how to restore a deleted worktree? Noam Postavsky
2018-01-04 22:04   ` Stephen Leake
2018-01-04 23:14     ` Andreas Schwab
2018-01-04 14:07 ` Nathan Moreau
2018-01-04 22:07   ` Stephen Leake
2018-01-07 20:15     ` Nathan Moreau
2018-01-07 20:22       ` Andreas Schwab
2018-01-04 14:49 ` Andreas Schwab
2018-01-04 18:29 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wp0x3f7c.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.