Git Status - List only the direct subfolders with changes, not inner files

前端 未结 1 1153
太阳男子
太阳男子 2021-01-26 13:01

I love using Git to organize version control and backup all my web files in Wordpress.

After updating plugins, I\'d like to get the list of changes only on the direct s

相关标签:
1条回答
  • 2021-01-26 13:26

    try this:

    git status --porcelain | awk '{print $2}' | xargs -n 1 dirname | uniq
    

    awk '{print $2}' 
    

    get filename from list

    xargs -n 1 dirname 
    

    extract dir from a full path

    uniq
    

    show only unique directories

    uniq can be a little slower when you have many lines

    0 讨论(0)
提交回复
热议问题