Добавить Makefile.other

This commit is contained in:
2025-10-24 08:09:10 +00:00
parent 08f0fba5ab
commit 9eb3f1ea4f

13
Makefile.other Normal file
View File

@@ -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!"