In the working directory, create a new file '.gitignore'; basically this file's each line will contain a entry(file or folder name or file extension with filter) to be ignored by git to add or commit in the repository. for example if we want ignore all of the file with '.debug' extension then add a entry '*.debug' in the file. Stage this file '.gitignore' using 'git add .' and then commit it to repository.