简体   繁体   中英

how to ignore a directory and its sub-directories in gitignore

I want to ignore public folder and its inside folders and file in git

public/app
public/dist/file.html
public/dist/bower_components/
public/dist/fonts/
public/dist/scripts/

i want to ignore all of them and their inside files i followed this link Add newly created specific folder to .gitignore in Git

I am doing it like this in .gitignore file

public/app/*
public/dist//*
public/dist/bower_components/*
public/dist/fonts/*
public/dist/scripts/

but its not working ,i can stil see these files on git status

忽略/public/ (斜杠前和后,没有星号)。

First verify git status if you have already add this folders. If you was add, try to remove them git rm -r --cached directory .

Next put only public/* in .gitignore to ignore all file in public's folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM