Skip to content

Instantly share code, notes, and snippets.

@stoeckley
Forked from jmathai/git_stage_helper
Created December 21, 2016 15:30
Show Gist options
  • Select an option

  • Save stoeckley/06010160401d9682d540d808476dfb2e to your computer and use it in GitHub Desktop.

Select an option

Save stoeckley/06010160401d9682d540d808476dfb2e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Ease staging of files
for i in $(git status | grep -A 10000 "not updated" | grep modified) ; do
if [ -f $i ] ; then
git diff $i;
echo -n "Add this to stage? [y/n]: ";
read ans;
if [ "$ans" == "y" ] ; then
git add $i;
echo "++++++ Added to stage ($i) ++++++";
fi;
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment