Removing a file/folder from git git filter-branch --prune-empty --tree-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all rm -rf .git/refs/original/ git reflog expire --expire=now --all git gc --aggressive --prune=now
View pre-push.sh
#!/bin/bash | |
# By https://gist.github.com/pixelhandler | |
# Modified by https://gist.github.com/vistik | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# |
View gollum.config.ru
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gollum/app' | |
gollum_path = File.expand_path(File.join(File.dirname(__FILE__), 'database.git')) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO | |
Precious::App.set(:gollum_path, gollum_path) | |
Precious::App.set(:default_markup, :markdown) # set your favorite markup language | |
Precious::App.set(:wiki_options, {:live_preview => false, :universal_toc => false, :user_icons => 'gravatar'}) | |
module Precious | |
class App < Sinatra::Base | |
# Creates a simple authentication layer |
View remove_file_or_folder_from_git.txt
git filter-branch --prune-empty --tree-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all | |
git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now |