From: Mike Friedrich <mfriedrich@kns.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: removed submodules shown as untracked when switching branches
Date: Thu, 22 Feb 2018 20:26:27 +0000 [thread overview]
Message-ID: <6add3709b4eb469bb7c8d6319637b53a@USEPRDEX2.corp.kns.com> (raw)
Hi,
When switching clean branches I see untracked files appearing where I expect to see "nothing to commit, working tree clean".
This happens when submodules get removed on one branch but its present in another.
I expect git to either not mark the submodule in git status as untracked or git to remove the submodule as it would for ordinary tracked files which do not exist on a branch anymore.
Tested on Windows with: git version 2.15.1.windows.2
Tested on Ubuntu Linux with same output: git version 2.14.1
Test:
git init test
git init submodule
cd submodule
touch file.txt
git add file.txt
git commit -m "test"
cd ../test
touch initial.txt
git add initial.txt
git commit -m "initial"
git checkout -b develop
git status
#On branch develop
#nothing to commit, working tree clean
git submodule add ../submodule sub
git add sub
git commit -m "submodule added"
git status
#On branch develop
#nothing to commit, working tree clean
git checkout master
git status
#On branch master
#Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# sub/
#
#nothing added to commit but untracked files present (use "git add" to track)
# expected: nothing to commit, working tree clean
git submodule update
# (no output)
git submodule
# (no output)
git status
#On branch master
#Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# sub/
#
#nothing added to commit but untracked files present (use "git add" to track)
# expected: nothing to commit, working tree clean
git clean -dfx
#Skipping repository sub/
Best Regards,
Mike Friedrich
________________________________
This email is non-binding, is subject to contract, and neither Kulicke and Soffa Industries, Inc. nor its subsidiaries (each and collectively “K&S”) shall have any obligation to you to consummate the transactions herein or to enter into any agreement, other than in accordance with the terms and conditions of a definitive agreement if and when negotiated, finalized and executed between the parties. This email and all its contents are protected by International and United States copyright laws. Any reproduction or use of all or any part of this email without the express written consent of K&S is prohibited.
next reply other threads:[~2018-02-22 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 20:26 Mike Friedrich [this message]
2018-02-22 23:53 ` removed submodules shown as untracked when switching branches Stefan Beller
2018-02-23 0:41 ` Mike Friedrich
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=6add3709b4eb469bb7c8d6319637b53a@USEPRDEX2.corp.kns.com \
--to=mfriedrich@kns.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).