Git shared repository

From Genecats
Jump to navigationJump to search


The git shared repositories used by the genome browser staff and genecats is located at hgwdev:/data/git

Inside there are various bare repositories including kent.git. See this Getting Started With Git page for more info.

There are cron jobs that update various copies of kent.git such as the hourly copies that are refreshed with git pull, and a copy which is updated every 15 minutes that the general public fetches from, both directly with git, and with web-git. In addition the admins keep daily, weekly, monthly, and yearly backups of hgwdev:/data/git.

From Galt's crontab:

# update git public repo
0,15,30,45      *  *  *  *   /data/git/public/refresh.csh
0               *  *  *  *   /data/git/backup/refresh.csh


Periodically (at least every 6 months, but maybe more often) git needs to garbage-collect the shared bare repository. Not ONLY to save space, it ends up saving time too. It had grown to 2GB! After gc, it was only 288MB. Also, it had taken git bare clone took 13 minutes to run. After gc, the git bare clone took less than 1 second. And then git regular clone was only 3 seconds!

# Send out announcement to genecats and browser-staff 
# that we will be doing git maintenance for 5 minutes.
ssh hgwdev
cd /data/git
# move the real repo aside so nobody can use it.
mv kent.git kent-real.git
# get rid of the old copy if any
rm -fr kent.git.copy
# make a new backup copy just to be safe
rsync -a kent-real.git kent.git.copy
cd kent-real.git
# only takes 5 minutes
git --bare gc
cd ..
mv kent-real.git kent.git

That's it! It doesn't seem that the other git repos in /data/git/ get enough commits to even bother with gc.

Apparently, when we run a git on a non-bare clone such as your personal ~/kent, it does gc automatically.

It is preferable to perform this garbage collection late at night when few people are working.



Garbage Collection Done:

  • 2012-07-23
  • 2013-03-26
  • 2013-07-29
  • 2014-08-08
  • 2015-04-03
  • 2016-01-04
  • 2016-09-07
  • 2018-04-16
(I did it but did not get logged here)
  • 2020-05-27