diff --git a/Makefile.other b/Makefile.other new file mode 100644 index 0000000..ff04c99 --- /dev/null +++ b/Makefile.other @@ -0,0 +1,13 @@ +.PHONY: clean-branches + +clean-branches: + @echo "Fetching updates from origin..." + git fetch --prune + @echo "Checking for local branches missing on origin..." +ifeq ($(OS),Windows_NT) + @for /f "tokens=1,2*" %%i in ('git branch -vv ^| findstr /C:": gone]"') do git branch -d -D %%i + @for /f "tokens=1,2*" %%i in ('git branch -vv ^| findstr /C:"[удалённый путь] отсутствует"') do git branch -d -D %%i +else + @git branch -vv | grep -E ': gone\]|отсутствует' | awk '{print $$1}' | xargs -r git branch -d -D +endif + @echo "Done!" \ No newline at end of file