I came across a very weird thing about gitignore files that they happen to use forward slash for denoting a particular directory
Project/module1/cppfiles
Rather than the usual backslash normally used in command prompt for denoting a particular directory.
Project\module1\cppfiles
Is this completely syntactical or it has some reason behind it?
I soonly found a windows documentation, compare here, which tells:
Windows users: All file paths in the .gitignore file use a forward slash separator and not a backslash.
git uses forward slashes in the .gitignore
for compatibility with unix syntax, where you separate folders by forward and not by backward slash. This probably is related to two things:
It's because Git was originally written to run on Linux, and the /
is the path separator for Linux.
The forward-slash paths will work fine in Windows. In fact, in many places in Windows, if you type your paths with forward slashes, it'll correct them for you automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With