From: Erik Cervin Edin <erik@cervined.in>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Tim Chase <git@tim.thechases.com>,
git@vger.kernel.org,
Daryl Van Den Brink <daryl.vandenbrink@maptek.com.au>
Subject: Re: stashing only unstaged changes?
Date: Fri, 24 Jun 2022 15:49:08 +0200 [thread overview]
Message-ID: <CA+JQ7M8gaEWHHdx2or2kQfYpp=XBxQS=pXtEOS4x5SBdpPWdkQ@mail.gmail.com> (raw)
In-Reply-To: <220624.86tu8ai4mr.gmgdl@evledraar.gmail.com>
On Fri, Jun 24, 2022 at 3:20 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> Is what you want equivalent to:
>
> # save the "git add -p"'d chunks
> git stash push --staged
> # save the "uncommitted"
> git stash push
> # pop the previously staged
> git stash pop --index stash@{1}
>
> ?
Never noticed --staged before.
I just tried to
seq 1 3 >> bar
then git add -p to stage with 2 and 3
followed by a git stash push --staged but that gave me the error
> error: patch failed: bar:2
> error: bar: patch does not apply
> Cannot remove worktree changes
But I'm guessing the command (and approach) work fine if the
staged/unstaged are in different files.
next prev parent reply other threads:[~2022-06-24 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 19:26 stashing only unstaged changes? Tim Chase
2022-06-24 8:16 ` Reto
2022-06-24 20:53 ` Tim Chase
2022-06-24 9:55 ` Konstantin Khomoutov
2022-06-24 11:23 ` Erik Cervin Edin
2022-06-24 20:38 ` Tim Chase
2022-06-24 13:09 ` Ævar Arnfjörð Bjarmason
2022-06-24 13:49 ` Erik Cervin Edin [this message]
2022-06-24 15:32 ` Ævar Arnfjörð Bjarmason
2022-06-24 19:47 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+JQ7M8gaEWHHdx2or2kQfYpp=XBxQS=pXtEOS4x5SBdpPWdkQ@mail.gmail.com' \
--to=erik@cervined.in \
--cc=avarab@gmail.com \
--cc=daryl.vandenbrink@maptek.com.au \
--cc=git@tim.thechases.com \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).