How to open all modified files with git?

How to open all deleted, modified, and created files since the last git commit, I tried using git status first, but it was difficult to parse, so I found git status --porcelain was easier to parse and with awk + vim + some bash magic it was easy to do.

  • How do I view all ignored patterns set with svn:ignore recursively in an SVN repository?
  • Ever need to parse the svn log for files committed by a particular user since a certain date?
  • Ignore empty results for xargs in Mac OS X
  • How to list the last occurance of a specific string in Terminal
  • Looking for a way automate the “bump version” with git flow
  • Bash alias of an svn command piped to awk
  • What are the differences between these git diff commands?
  • When open-sourcing a live Rails app, is it dangerous to leave the session key secret in source control?
  • TFS/GIT in VS Cannot switch to master because there are uncommitted changes
  • git setup for a single developer?
  • Find when line was deleted
  • git cherry-pick -x default
  • 4 Solutions collect form web for “How to open all modified files with git?”

    So, I found the solution with vim:

    vim $(git status --porcelain | awk '{print $2}')
    

    And I post this question + answer just to answer it myself and share it to the internet

    git ls-files --modified --deleted --others -z | xargs -0 vim
    

    In order for this to work when im in a sub folder of the git repo i just use the -s option to git status. Vim option -O opens the files in vertical split.

    vim -O $(git status -s | awk '{print $2}')

    From this blog, you can edit ~/.gitconfig and add this line:

    [alias]
      edit = !$EDITOR $(git status --short | awk '$1 ~ /^M|A|U/ {print $2}' )
    

    Now, git edit will open all modified files

    Git Baby is a git and github fan, let's start git clone.