简体   繁体   中英

Only push files with certain extensions to GitHub

I am working on a data analysis project whose directory structure looks like following

pipeline1.py
pipeline2.py
...
pipelineN.py
data/
config/
test/

where folder data/ mixes a lot of data processing Python scripts and raw data.

Now I am almost done with the data preprocessing in data/ and ready to commit changes to my personal GitHub repo. However, I am not sure how could I push only .py in this folder.

I have tried adding following to .gitignore but this will ignore the data/ entirely and hence not desirable.

!*.py

data/

You should use that way:

first ignore everything in that folder

data/

than except those files

.data/*.py

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