gitignore - git very slow with many ignored files -


i have set repository include working directory has many tens of thousands of files, thousands of directories, many gb of data. directory located on samba share. want have few dozen source files within directory under version control.

i have set gitignore file thusly , works:

# ignore *  # except couple of files in directory !*.pin !*.bsh !*/ 

operations on repository (such commit) takes several minute carry out. long reasonably work done. suspect slowdown because git trawling through every directory looking files may have been updated.

there few locations in working directory have files want track, tried narrow down set of files examine using query:

* !/version_2/analysis/abcd.pin !/version_2/analysis/*.bsh !*/ 

this works, still slow less qualified gitignore. i'm guessing final line killer, no matter how tried make unignore patterns specific, had include final wildcard clause in order process find files commit.

so 2 part question is

1) there better way set gitignore file speed commit process including narrow set of directories , file types contain relevant results?

2) there other tweaks git or samba required make work more efficiently?

thanks,

tom

after fiddling around bit, have found way improve performance modifying .gitignore file.

the performance problem caused approach of ignoring , specifying unignore. had nice concise specification (4 lines), slow. caused git walk entire directory tree in order detect changed.

my new , improved approved approach use exclude patterns. using can indicate large branches of tree prune. had add more lengthy set of documents , file types exclude , took few iterations right because there many. due nature of data sets there may more maintenance of .gitignore file required in future if new file types show up, small price pay.

here final .gitignore file looks like:

# prune large input data , results folders ever occur ../data/ ../results/  # exclude document types don't need versioning, # leaving types of interest *~ *# *.csv *.doc *.docx *.gif *.htm *.html *.ini *.jpg *.odt *.pdf *.png *.ppt *.pptx *.xls *.xlsx *.xlsm *.xml *.rar *.zip 

commit times down few seconds.

overall still pretty simple, although not clean initial 4-liner.

after review, think problem became victim of own premature optimization.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -