4 git snippets

Backup an entire GitHub repository

The following shell script will back up an organization's GitHub repositories, including the all branches of the source tree and the GitHub wiki and issue list (if any).

(Also at rodw/backup-github.sh.)

Published 1 Jan 2014
Tagged git, backup and ops.

 

'.gitignore' boilerplate for CoffeeScript/Node.JS projects.

# node.js / coffeescript
#--------------------------------------------------------------------
docs/*.html
docs/docco
lib-cov
lib/*.js
node_modules
README.html
test/*.js

 

'.gitignore' boilerplate for common temporary files.

A list of patterns for the names of common temporary and noise files, to be used as boilerplate in .gitignore, .hgignore, .svnignore etc.

# various tmp and noise files
#---------------------------------------------------------------------
$RECYCLE.BIN/
*.*~
*.log
*.pid
*.un~
*~
.*.sw[a-z]
.DS_Store
.Spotlight-V100
.Trashes
.\#*
._*
.directory
.elc
/.emacs.desktop
/.emacs.desktop.lock
Desktop.ini
Session.vim
Thumbs.db
\#*\#
auto-save-list
log
logs
temp
tmp
tramp
Tagged git.

 

backup a git repository with 'git bundle'

Run:

cd REPOSITORY_WORKING_DIRECTORY
git bundle create PATH_TO_BUNDLE.git --all

to create a single-file backup of the entire repository.

Note that the bundle file is a functional Git repository:

git clone PATH_TO_BUNDLE.git MY_PROJECT
Tagged git, backup, one-liner, ops and tool.

 

This page was generated at 4:16 PM on 26 Feb 2018.
Copyright © 1999 - 2018 Rodney Waldhoff.