Open your code editor
Add the following lines to ignore path . e.g ignore node_modules/
path:node_modulespath:temp
Save it as .hgignore
Commit and push!