#git

Git tricks

Backup an entire repository to one file using git bundle: git bundle create BACKUPFILE.git --all --tags --remotes Backup an entire local repository (with cache etc.) using rsync rsync -hxPavilyzH --stats --delete .git/ USER@HOST:/PATH/TO/BACKUP.git/ Automatically clean the repository of unneccesary files using git gc > du -chs .git 17M .git 17M total > git gc Counting objects: 12937, done. Compressing objects: 100% (7859/7859), done. Writing objects: 100% (12937/12937), done. ...