forked from colonelpanic/dotfiles
		
	Add a bunch of git aliases including untracked, root and ignore.
This commit is contained in:
		 Submodule dotfiles/emacs.d updated: 32aa532c7e...11ab911344
									
								
							@@ -11,9 +11,12 @@
 | 
			
		||||
        suir = submodule update --init --recursive
 | 
			
		||||
        amend = commit -a --amend -C HEAD
 | 
			
		||||
        modified = diff HEAD --name-only
 | 
			
		||||
        untracked = "!u() { git status -s | grep "??" | awk '{print $2}'; }; u"
 | 
			
		||||
        dirty = "!t() { test -n \"$(git status --porcelain)\"; }; t"
 | 
			
		||||
        # diff tracking branch merge base
 | 
			
		||||
        dtbmb = !git diff `git tb`...HEAD
 | 
			
		||||
        root = rev-parse --show-toplevel
 | 
			
		||||
        ignore = !"i() { printf \"\n$1\" >> "`git root`/.gitignore"; }; i"
 | 
			
		||||
 | 
			
		||||
        branches = branch -a
 | 
			
		||||
	remotes = remote -v
 | 
			
		||||
@@ -34,6 +37,8 @@
 | 
			
		||||
	reb = "!r() { git rebase -i HEAD~$1; }; r"
 | 
			
		||||
        # Diff a file or show it in git's pager if it is untracked
 | 
			
		||||
        du = "!d() { git ls-files $1 --error-unmatch 2>/dev/null 1>/dev/null && git diff $1 || `git config --get core.pager` $1; }; d"
 | 
			
		||||
        clean-branches = "!r() { git branch -r --merged ${1-origin/master} | xargs -n1 git branch -d; }; r"
 | 
			
		||||
        clean-remote-branches = 
 | 
			
		||||
 | 
			
		||||
[core]
 | 
			
		||||
	# Use custom `.gitignore` and `.gitattributes`
 | 
			
		||||
 
 | 
			
		||||
@@ -97,3 +97,7 @@ function clipboard() {
 | 
			
		||||
        reattach-to-user-namespace pbcopy
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function git_root() {
 | 
			
		||||
    cd `git root`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user