threads / discuss / 45728

FW: Issue in gitbash changing directory

Subject: FW: Issue in gitbash changing directory

## tl;dr

2 messages between Apr 18, 2017 and Apr 18, 2017.

replies: 1people: 2as markdown or json

Kevin Daudt· Apr 18, 2017, 16:53 UTC · re: Bonk, Gregory · lore

Re: FW: Issue in gitbash changing directory

On Tue, Apr 18, 2017 at 12:48:09PM +0000, Bonk, Gregory wrote:
Show 8 quoted lines
> 
> I accidently typed 'cd //'  and it worked.
> 
> gbonk@ICC11167 MINGW64 /c/git/mtb-messagehub-information-radiator (master)
> $ cd //
> 
> gbonk@ICC11167 MINGW64 //
> $ cd ..

This has very little to do with git, but more with bash (the shell that is interpretting the command. From a bash FAQ [1]:

Show 9 quoted lines
> E10) Why does `cd //' leave $PWD as `//'?
> 
> POSIX.2, in its description of `cd', says that *three* or more leading
> slashes may be replaced with a single slash when canonicalizing the
> current working directory.
> 
> This is, I presume, for historical compatibility.  Certain versions of
> Unix, and early network file systems, used paths of the form
> //hostname/path to access `path' on server `hostname'.
So this is kind of intentional.
[1]: https://tiswww.case.edu/php/chet/bash/FAQ

← back to recent threads