Advertisement
rezasurmar

Git_Tags_export

Feb 9th, 2025
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Ścieżka do repozytorium
  4. repo_dir="/path/to/your/repo"
  5. cd "$repo_dir"
  6.  
  7. # Pobranie wszystkich tagów
  8. git fetch --tags
  9.  
  10. # Stworzenie folderu do eksportu tagów
  11. mkdir -p exported_tags
  12.  
  13. # Eksportowanie każdego tagu do osobnego folderu
  14. for tag in $(git tag); do
  15.     echo "Tworzenie kopii dla tagu: $tag"
  16.     git checkout "tags/$tag"
  17.     mkdir -p "exported_tags/$tag"
  18.     git archive --format=tar HEAD | tar -x -C "exported_tags/$tag"
  19. done
  20.  
  21. echo "Eksport tagów zakończony!"
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement