I'm typing cd ~ C:\Desktop\gitPractice
And I get this return:
bash: cd: too many arguments
What do I need to fix here in order to be able to change directory?
I'm typing cd ~ C:\Desktop\gitPractice
And I get this return:
bash: cd: too many arguments
What do I need to fix here in order to be able to change directory?
cd expects one argument. You provide two - ~ and C:\Desktop\gitPractice.
Furthermore, bash in git for windows doesn't use drive letters. Thus the command will be cd /C/Desktop/gitPractice
As already said in extension, the Windows "CD" command does not know what a tilde is and only accepts one argument.
cmd /? help says:Changes the directory or displays its name.
CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]
.. Specifies that you want to change to the parent directory.
Enter "CD drive:" to display the current directory on the specified drive.
drive. CD without parameters displays the current drive and directory.
directory is displayed.
Use the /D option to change the current drive in addition to changing the directory.
also change the current drive.
If the command extensions are activated, CHDIR is changed as follows
changed:
The specified directory name is converted so that it matches the name in terms of upper and lower case.
case-sensitive to match the name on the drive. For example
CD C:\TEMP sets the current path to the directory C:\Temp if a directory with this name exists on the drive.
directory with this name exists on the drive.
The CHDIR command does not treat spaces as separators, so that it is
possible to change to a subdirectory whose name contains spaces
without enclosing the name in quotation marks. Example:
cd \WINNT\Profile\Username\Programs\Startmenu
is the same as:
cd "\WINNT\Profile\username\Programs\Startmenu"
If the command extensions are deactivated, the quotation marks must be
characters must be specified.
cdcommand under any operating system that I know of takes only a single argument. – doneal24 Feb 18 '24 at 21:38cd /D N:\other_folderto change the drive while using thecdcommand toother_folder– djdomi Feb 19 '24 at 07:24/Dpart is what's unlikely to be supported by bash. Bash doesn't have a concept of drive letters like Windows. – vidarlo Feb 19 '24 at 09:53bash, and the path indicates git for windows (which indeed has a bash component...). See my updated answer. – vidarlo Feb 19 '24 at 11:05