-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
43 lines (40 loc) · 1.96 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
########################
# GithubDirToSubmodule
# By Nick Yeates nyeates1 at umbc dot edu
# These set of shell scripts will automate the moving of many git
# subdirectories in an existing git repository. It moves directories,
# one by one, into separate repos, and then makes a submodule reference
# to that new seperate repo. The submodule is put into the original
# parent repo.
#
# Use the below workflow to use both of the files and an output.txt
# file in unison, to complete the job of transfering many directories
# over to seperate repos and submodules.
#
# See Notes in directoryList.sh and "Assumes" and "Troubleshooting"
# sections in githubDirToSubmodule.sh for additional information.
########################
Workflow
How to use the various files to turn sub-directories into separate repos and submodules
=Which sub-directories=
1) Update directoryList.sh with the 'Directory' variable referring to the repo where you have many subdirectories
2) Run directoryList.sh and examine output
- look that all directories you want are there and look right
- assure that each line looks like: /path/to/dir/nameOfDir nameOfDir/
3) Output to a file Ex: ./directoryList.sh > output.txt
4) Remove any directories that you dont want separated
=Change sub-directories into repos and submodules=
1) Set variables in githubDirToSubmodule.sh
- ParentRepoPath, DirectoryListingFile. NewContainingDir, GitHubUserName, GitHubToken and SuperprojectPath
- Assure that directories and repos exist
2) Assure that "break" is NOT commented out
- We want to only let the loop run once in order to test it and see that it works
- This is especially important if you have many subdirectories that you are running this on
3) Run loop once
- ./githubDirToSubmodule.sh
- Look for good output
4) Remove first directory from output.txt
- We have run it on this first one, and so now only need to run it on the others
5) Run script on all other directories
- remove the "break" to do this
- ./githubDirToSubmodule.sh