Skip to content

Instantly share code, notes, and snippets.

@sandordargo sandordargo/gitconfig
Last active Jul 1, 2019

Embed
What would you like to do?
git diff & add combined
[alias]
da = "! addprev() { while true; do \
read -p \"Do you wish to add this file? ([Y]es, [N]o, [P]atch)\" yn ; \
case $yn in \
[Yy]* ) git add $1; break;; \
[Pp]* ) git add -p $1; break;; \
[Nn]* ) exit;; \
* ) echo "Please answer yes, no or patch.";; \
esac \
done } ; \
gotoUsedDirectory() { \
if [ -n \"${GIT_PREFIX}\" ]; then \
cd ${GIT_PREFIX} ; \
fi \
} ; \
echo \"$1\" ; \
gotoUsedDirectory && git diff $1 && addprev $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.