From 29b5ed5f0b9409d053d06752d0b7956246f30922 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 17 Jan 2013 23:21:32 +0100 Subject: [PATCH] Add git_ignore, to ignore all untracked file --- .bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index d448584..224d1b1 100644 --- a/.bashrc +++ b/.bashrc @@ -158,8 +158,15 @@ alias cgcc="colout :[0-9]+: yellow standard | colout error | colout warning mage alias git_remotes="grep -A 2 \"\[remote\" .git/config|grep -v fetch|sed \"s/\[remote \\\"//\"|sed ':a;N;\$!ba;s/\"\]\n\s*url = /\t/g'" # Pretty git log -alias gitlog="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" +alias git_log="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" +function git_ignore() +{ + if [[ ! -f .gitignore ]] ; then + echo ".gitignore" > .gitignore + fi + git ls-files --other --exclude-standard >> .gitignore +} ################# # Configuration #