From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 817B31F5AE for ; Thu, 13 May 2021 07:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbhEMHuV (ORCPT ); Thu, 13 May 2021 03:50:21 -0400 Received: from bsmtp3.bon.at ([213.33.87.17]:9384 "EHLO bsmtp3.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhEMHuR (ORCPT ); Thu, 13 May 2021 03:50:17 -0400 Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp3.bon.at (Postfix) with ESMTPSA id 4FgkLp0zSWz5tlG; Thu, 13 May 2021 09:49:06 +0200 (CEST) Subject: Re: Git pathspecs difference in behavior between linux (wsl) and windows To: Alexandre Remy References: Cc: git@vger.kernel.org From: Johannes Sixt Message-ID: <81d06db6-fd91-7ec5-6aa5-84f69a227204@kdbg.org> Date: Thu, 13 May 2021 09:49:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 13.05.21 um 08:57 schrieb Alexandre Remy: > Hi, > > I do not understand why the same command works on linux and not on > windows. Is the pathspecs syntax differ or there is a problem on the > git windows version? > > * On windows (git version 2.31.1.windows.1) > > git status -- 'src/test.js' > On branch master > nothing to commit, working tree clean > > > * On linux (wsl: git version 2.25.1) > > git status -- 'src/test.js' > On branch master > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working directory) > modified: src/test.js > A classic git status gives the same result between linux and windows > (with correct file detected). Which shell did you use to invoke the Windows version? If it was from CMD or PowerShell, then you must not put the name in single-quotes: git status -- src/test.js The reason is that the single-quote does not have a special meaning for CMD and PowerShell like it does for a POSIX shell. -- Hannes