How to create .gitignore file

How to create .gitignore file

Asked on December 28, 2018 in Git.
Add Comment


  • 3 Answer(s)

    Just add the preferred command line to interface this GNU,Bash, etc.

    touch .gitignore
    

    Modification:

    Touch works on Windows as well as long as you produce the full path. This may  does not work for some users on Windows to the touch command  not be in the $PATH on some Win versions per default.

    C:\> "c:\program files (x86)\git\bin\touch.exe" .gitignore
    
    Answered on December 28, 2018.
    Add Comment

    Here the following solution:

    The simple way to create the .gitignore file in Windows Explorer to form a new file named .gitignore.. Skip the validation of having a file extension, because is actually has an empty file extension.

    Answered on December 28, 2018.
    Add Comment

    File is not added to a repository by default. Your favorite text editor to form the .gitignore file problem a git add .gitignore followed by git commit -m “message” .gitignore.

    > .gitignore
    git add .gitignore
    git commit -m "message" .gitignore
    
    Answered on December 28, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.