Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How git deals with folder names with spaces

Tags:

git

I have a folder by the name 31 Files of - oop. When I try running this command:

git rm -rf 31 Files of - oop

I get this fatal error :

fatal: pathspec '31' did not match any files

How do I need to prepare the folder names with spaces for use in git?.

like image 467
Gandalf Avatar asked Dec 27 '12 10:12

Gandalf


People also ask

How do you git add a file with spaces?

Surround the folder or file with a space in it with quotes! On Mac and Linux, you can add single quotes, but on Windows you'll have to use double quotes. …and everything worked as expected! This works for all the git commands: so add and diff , for instance, are included.

How do I navigate folders in git?

To change this current working directory, you can use the "cd" command (where "cd" stands for "change directory"). For example, to move one directory upwards (into the current folder's parent folder), you can just call: $ cd ..

Can git track folders?

Git will only track Files and the changes in them. So folders are tracked as part of the file changes in them. In order to create an empty folder and commit it, there have to be some files inside it.

What is a folder called in git?

In Git, this database is known as a repository and its structure is inspired by the Linux file system. The repository maintains a history of the changes to our codebase. The . git folder contains all information that is necessary for the project and all information relating commits, remote repository address, etc.


1 Answers

Try in this way :

git rm -rf "31 Files of - oop" Where 31 Files of - oop is your file name.

like image 180
Sachin Prasad Avatar answered Sep 29 '22 08:09

Sachin Prasad