Most of the time, there are certain files and folders that you do not want to track in your Git repository. You have to explicitly tell Git which ones to ignore. You provide this information in a special file you create in the root of your repository. It is simply a text file named .gitignore. Notice that there is no filename, just an extension. Windows will not let you create a file with no name, so you have to create the file using a command in Git Bash. Run the following from your root folder:
echo /bin > .gitignore
This command will create a file named .gitignore and put the "/bin" text in it. This is the start of a very basic git ignore file. It tells Git to ignore a folder named bin and all files contained in it. You can add individual files and folders on separate lines. Just double click the file in Windows and edit in Notepad.
No comments:
Post a Comment