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.

  • git commit trigger to block byte order mark
  • How to list the last occurance of a specific string in Terminal
  • Bash alias of an svn command piped to awk
  • AWK statement inside a git alias
  • Convert .gitignore to rsync merge filter include file? (with sed or awk)
  • How can I find all the merges that had conflicts in a Mercurial repository?
  • Bare git repo post-receive hook no longer able to checkout
  • git (any SCM) and compiling object files, switching branches, physiology thereof
  • git request-pull from local branch to remote master
  • Why does git-svn clone set 'master' to a random branch?
  • How git push other branch to remote/origin?
  • Why choose VSO over IaaS TFS 2013/15
  • 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.