Skip to content

Instantly share code, notes, and snippets.

@coord-e
Last active May 28, 2017 06:26
Show Gist options
  • Save coord-e/431a8f00a2c909d5b3c5a4a7434981f7 to your computer and use it in GitHub Desktop.
Save coord-e/431a8f00a2c909d5b3c5a4a7434981f7 to your computer and use it in GitHub Desktop.
git-add-untracked () {
FILES=$(git ls-files --others --exclude-standard $1)
echo $FILES | sed '/^$/d'
echo "Adding $(echo ${FILES:+$FILES" "} | grep -o " " | grep -c ^ | sed '/^$/d') files"
echo $FILES | xargs git add
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment