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.

  • Convert .gitignore to rsync merge filter include file? (with sed or awk)
  • Find last commit in Git repo that contains a certain string pattern
  • Escaping characters in Ruby Shell
  • Release notes from git log using bash awk
  • How to list the last occurance of a specific string in Terminal
  • Bash alias of an svn command piped to awk
  • Xcode git Auto-Detect Email Error
  • git - how to handle a branch “test”
  • “Share working copy?” in Xcode when adding a project under git version control
  • git's equivalent of svnlook changed
  • What parts of a Django project should I not include in Git?
  • git init will not create git directories for me
  • 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:

      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.