From: "Sven R. Kunze" <srkunze@mail.de>
To: git@vger.kernel.org
Subject: git subtree pull vs git pull
Date: Thu, 18 Feb 2021 20:49:28 +0100 [thread overview]
Message-ID: <988c57dd-58dc-8ec7-7b00-60313473277c@mail.de> (raw)
Hey everyone,
that's my first question here, so please bare with me. I got an
unexplained behavior using git-subtree.
Please consider (git --version := 2.30.0):
me@host:~/repo$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: somechanges
no changes added to commit (use "git add" and/or "git commit -a")
me@host:~/repo$ git pull --no-rebase
Already up to date.
me@host:~/repo$ git subtree pull --prefix=prefix/ subtree-origin master
Working tree has modifications. Cannot add.
My expectation would be that I can pull the subtree as I could pull the
main repo without any issue. The subtree does not even touch the
modified file.
Is there a reason for this or can this restriction be lifted?
Where am I coming from? The work-around would be "git stash, git subtree
pull, git stash pop" which would work on a first glance, but other tools
like IDEs lose their context information regarding these changes (e.g.
changelists). This can be a little bit annoying given that mostly there
are not changes at the subtree-origin.
Best regards,
Sven
reply other threads:[~2021-02-18 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=988c57dd-58dc-8ec7-7b00-60313473277c@mail.de \
--to=srkunze@mail.de \
--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).