Git

git delete multiple branch

  1. Open the terminal, or equivalent.

  2. Type in git branch | grep "<pattern>" for a preview of the branches that will be deleted.

  3. Type in git branch | grep "<pattern>" | xargs git branch -D

example that only detect changed file that has .py extention

$  95
nodemon --delay 100ms -e "echo (git diff develop --name-only --diff-filter=d | grep -E '\.py$' | tr '\n' ' ')" --exec "pylint --reports=y --output-format=colorized *"

useful script

—diff-filter=d 는 deleted를 제외한 결과를 가져다줌.

삭제한 파일을 grep하고 싶지 않아서 저게 꼭 필요한 옵션이었는데

해당 결과를 받으려면 아래처럼 입력해야함.

-diff-filter=ACMRTUXB

7글자 다 치는게 말이 안된다 생각해서 document 보니 소문자로 입력하면 exclude옵션으로 처리해줌.

해서 아래처럼 짰음.

git diff develop --name-only --diff-filter=d | grep -E '\\.py$' | tr '\\n' ' '

아래는 완성된 스크립트중 일부.(일부임! 너무길어서 일부만 넣음)

nodemon --delay 100ms -e "echo (git diff develop --name-only --diff-filter=d | grep -E '\.py$' | tr '\n' ' ')" --exec "pylint --reports=y --output-format=colorized *"

submodule

after apply submodule on your repository, you must set root directory in you IDE

Last updated

Was this helpful?