From: Torsten Bögershausen Date: Mon, 11 Mar 2019 17:55:19 GMT Subject: Re: `git add <>` results in "fatal: ... is outside repository" Message-ID: <20190311175519.6lbppv5u44w2u4sj@tb-raspi4> In-Reply-To: <10972e0e-7fe1-437f-efe6-cff82a1205e0@kdbg.org> On Mon, Mar 11, 2019 at 06:48:11PM +0100, Johannes Sixt wrote: > Am 10.03.19 um 23:41 schrieb Anthony Sottile: > > git init longname-repo > > cd longname-repo > > touch f > > git add ..\longna~1\f > > > ... > > > > C:\Users\Anthony\AppData\Local\Temp\t\pre-commit-hooks\longname-repo>git > > add ..\longna~1\f > > fatal: ..\longna~1\f: '..\longna~1\f' is outside repository > > This has nothing to do with long vs. short path names. It would report > the same error when you say > > git add ..\longname-repo\f > > -- Hannes You can probably do another test: mkdir longname-rexxx git init longname-repo cd longname-repo touch f git add ..\longna~1\f And now nobody knows for shure if "longna~1" is longname-rexxx or longname-repo It may happen that it is longname-rep at this point in time, at your machine. It may happen that it is a complete different directory on another machine, or even on your machine. For that reason, to avoid that someone tampers data outside a repo, "../" (or ..\ under windows) is not accepted by Git.