Skip to content

Instantly share code, notes, and snippets.

@mauricioprado00
Last active August 4, 2017 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricioprado00/6888a2fb1aa9f2961ecdf4405f2f98aa to your computer and use it in GitHub Desktop.
Save mauricioprado00/6888a2fb1aa9f2961ecdf4405f2f98aa to your computer and use it in GitHub Desktop.
New command for adding only modified files to stage
#!/bin/bash
# usage:
# git addmodified
git add $(git status --porcelain | awk '/^.M/{print $2}')
# New command for adding only modified files to stage
# save it with:
# sudo curl https://gist.githubusercontent.com/mauricioprado00/6888a2fb1aa9f2961ecdf4405f2f98aa/raw/git-addmodified > /usr/local/bin/git-addmodified
# chmod +x /usr/local/bin/git-addmodified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment