From: David Turner <novalis@novalis.org>
To: git@vger.kernel.org
Subject: git reset <tree-ish> <paths> of addition of a submodule?
Date: Thu, 30 Nov 2017 12:05:07 -0500 [thread overview]
Message-ID: <1512061507.9882.374.camel@novalis.org> (raw)
git submodule add https://my-git-repo blort
git commit -m 'add a submodule'
git reset HEAD^ blort
The reset deletes the gitlink, but does not delete the entry in
.gitmodules. On one hand, this is exactly what the user asked for --
they wanted the path 'blort' to be changed in the index, and that's
what they got. On the other hand, the behavior differs from git rm,
and seems confusing: most folks don't want an entry in .gitmodules
which doesn't correspond to a gitlink.
If reset isn't the right thing for me to do when I want to say "oops"
about adding a submodule, then what is? I could do:
git reset HEAD^ blort .gitmodules
but what if I added two submodules and only wanted to undo the addition
of one?
next reply other threads:[~2017-11-30 17:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 17:05 David Turner [this message]
2017-11-30 17:10 ` git reset <tree-ish> <paths> of addition of a submodule? David Turner
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=1512061507.9882.374.camel@novalis.org \
--to=novalis@novalis.org \
--cc=git@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).