How to count the total LOC in Bitbucket's repo bare-repo?
#!/bin/bashtargetPath=/data/atlassian/bitbucket-data/shared/data/repositories/temp=0total=0filename=branch_count.loglog=$targetPath/$filenameecho "Script Start -- $(date +%Y%m%d_%H%M)" >> $logfor f in `find $targetPath -maxdepth 1 -type d`;do cd $f pwd | tee -a $log for file in $(git ls-tree --name-only -r HEAD); do temp=`git show HEAD:"$file" | grep -v ^\# | wc -l` total=$(($total + $temp)) echo $temp | tee -a $log donedoneecho "Script End -- Total Branch in all Repo:$total" | tee -a $log
Sorry about the messy scripts. Rather amateur and in rush!
It looks like you're new here. Sign in or register to get started.