0

I've a problem with a tutorial I follow from a book. I'm making a website with Django and Python. I'm now at the chapter where I export the website to an server.

I have to use Git in order to have some like a back-up for when anything goes wrong. Now I need to make a file, .gitignore, to let Git ignore some files. It must start with a dot and has no file extension.

I already knows how to make a file with no extension, to fill in the save field "filename". When I use ".gitignore" the file isn't visible, only the icon and nothing more.

I've tried it with another way, make a no file extension to type "gitignore", save it and then edit the name in .gitignore. But then Windows gives an error: "You must specify a filename"

It's about having a file with no extension beginning with a dot, I don't want to create a txt file.

Does anyone knows this problem and have a way to fix this?

  • Add a '.' at the end in the Explorer and Windows will remove it... – Philippe Jan 22 '17 at 22:42
  • I tried, but when I do the file changes to it, it becomes a txt file. I want to keep it a no file extension. –  Jan 23 '17 at 18:03
  • I've tried in WinRar to edit the filename there to add a dot at the beginning, but the file will change to a txt and the name is invisible. Now it's only a txt logo with no name. –  Jan 23 '17 at 18:10
  • Hope your Explorer setting is set to see file extensions in the Explorer. And then just create with the Explorer a file named `.gitignore.`.No more, no less, no other softwares. – Philippe Jan 24 '17 at 00:36
  • Yes, I've changed the settings. I've had the same as yesterday, but I found another article on the web who told me it was okay to not see the name after the file. This is a lot stranger than I thought, but I hope it works. –  Jan 24 '17 at 18:50

1 Answers1

0

Open git bash and form the terminal create the file. now you can edit it as well.

enter image description here

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • I do not have much sense of this program. Git won't even start anymore on my pc and I don't know what it is... But if it starts could you tell me how you type this? (on Windows) –  Jan 23 '17 at 18:24