Advertisement
Guest User

demo git worktree stuff.

a guest
Aug 28th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | Software | 0 0
  1. #!/bin/bash
  2. rm -rf app
  3. mkdir -p app app/activities app/worktrees app/components
  4. declare -a components=("_main" "lib1" "lib2" "lib3")
  5. for component in ${components[@]}; do
  6.   mkdir -p app/components/$component
  7.   cd app/components/$component
  8.   git init
  9.   echo "$component text file\n" > ${component}_file.txt
  10.   cd -
  11. done;
  12.  
  13. exclude_git="-I 'refs' -I objects -I info -I logs -I index " \
  14.   "-I packed-refs -I hooks -I FETCH_HEAD -I branches -I config -I description"
  15. clear
  16. echo $exclude_git
  17. tree  -a $exclude_git -I 'refs' -I 'objects' -I 'info' -I 'log's -I index \
  18.       -I packed-refs -I hooks -I FETCH_HEAD -I HEAD -I branches -I config -I description
  19.  
  20. output:
  21.  
  22.  
  23. .
  24. ├── app
  25. │   ├── activities
  26. │   ├── components
  27. │   │   ├── lib1
  28. │   │   │   ├── .git
  29. │   │   │   └── lib1_file.txt
  30. │   │   ├── lib2
  31. │   │   │   ├── .git
  32. │   │   │   └── lib2_file.txt
  33. │   │   ├── lib3
  34. │   │   │   ├── .git
  35. │   │   │   └── lib3_file.txt
  36. │   │   └── _main
  37. │   │       ├── .git
  38. │   │       └── _main_file.txt
  39. │   └── worktrees
  40. ├── example
  41. ├── .git
  42. ├── LICENSE
  43. ├── README.md
  44. └── tree.gitignore
  45.  
  46. 14 directories, 8 files
  47. pac1@Spinnaker:/work/trees/git_stuff$
  48.  
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement