Rename gitignore.txt to . gitignore

Asked

Viewed 1,666 times

4

I created a gitignore file on Windows, so that some unnecessary files are not uploaded to Github. However, this file is with the extension ". txt" (gitignore.txt). I want to leave you only as .gitignore.

How can I do this ? Is there any possibility to rename it from the command line?

3 answers

5


Through explorer it is not possible to rename a file so that it has only extension, it is considered as having no name, which is not allowed.

The solution is to open a command window and use the command rename:

  • In the explorer open the folder where the file is.
  • With the key shift click with the right mouse button on an empty area of the folder.
  • In the menu shown choose "Open command window here"
  • In the window you opened type the command rename gitignore.txt .gitignore
  • Keystone enter.
  • Thank you manage to resolve,.

  • 1

    I don’t know if you noticed but the answer you accepted is not completely correct: Via explorer you can delete the extension but it is not possible to put the . to the left of the name.

  • wrong mark , sorry.

  • 1

    I also found a command here in the git terminal itself this: mv .gitigonre.txt . gitignore

1

On the command line type:

ren .gitignore.txt .gitignore

To access the command line from the current folder go to the address bar and type cmd.

Via explorer just press F2 and remove the extension.

  • Thank you manage to resolve,.

1

You can open your file in the notepad and use save as. In the Save As window select tipo de arquivo as todos(*) and remove . txt from the extension.

Or by the command line go to the folder of your file and use:

rename .gitignore.txt .gitignore
  • Thank you manage to resolve,.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.