|
1 | 1 | # Langkah Migrasi dari Subversion ke Git |
2 | 2 |
|
3 | 3 | 1. Dump repository Subversion |
4 | | -```shell |
5 | | -svnadmin dump /path/ke/repo/svn > nama-file-dump |
6 | | -``` |
| 4 | + ```bash |
| 5 | + svnadmin dump /path/ke/repo/svn > nama-file-dump |
| 6 | + ``` |
7 | 7 |
|
8 | 8 | 2. Copy ke pc kita sendiri supaya cepat prosesnya |
9 | 9 |
|
10 | 10 | 3. Restore lagi |
11 | | -```shell |
12 | | -svnadmin load /path/ke/repo/svn < nama-file-dump |
13 | | -``` |
| 11 | + ```bash |
| 12 | + svnadmin load /path/ke/repo/svn < nama-file-dump |
| 13 | + ``` |
14 | 14 |
|
15 | 15 | 4. Checkout |
16 | | -```shell |
17 | | -svn co file:///path/ke/repo/svn checkout-project-svn |
18 | | -``` |
| 16 | + ```bash |
| 17 | + svn co file:///path/ke/repo/svn checkout-project-svn |
| 18 | + ``` |
19 | 19 |
|
20 | 20 | 5. Generate authors file |
21 | | -```shell |
22 | | -#!/usr/bin/env bash |
23 | | -authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq) |
24 | | -for author in ${authors}; do |
25 | | - echo "${author} = NAME <USER@DOMAIN>"; |
26 | | -done |
27 | | -``` |
28 | | -Simpan hasilnya ke `file-authors.txt`. |
29 | | -Ini akan kita gunakan di langkah selanjutnya. |
| 21 | + ```bash |
| 22 | + #!/usr/bin/env bash |
| 23 | + authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq) |
| 24 | + for author in ${authors}; do |
| 25 | + echo "${author} = NAME <USER@DOMAIN>"; |
| 26 | + done |
| 27 | + ``` |
| 28 | + Simpan hasilnya ke `file-authors.txt`. Ini akan kita gunakan di langkah selanjutnya. |
30 | 29 |
|
31 | 30 | 6. Checkout lagi menggunakan `git-svn` |
32 | | -```shell |
33 | | -git svn clone --stdlayout --no-metadata -A file-authors.txt file:///path/ke/repo git-svn-migrasi-project |
34 | | -``` |
| 31 | + ```bash |
| 32 | + git svn clone --stdlayout --no-metadata -A file-authors.txt file:///path/ke/repo git-svn-migrasi-project |
| 33 | + ``` |
35 | 34 |
|
36 | 35 | 7. Masuk ke folder hasil clone |
37 | | -```shell |
38 | | -cd git-svn-migrasi-project |
39 | | -``` |
| 36 | + ```bash |
| 37 | + cd git-svn-migrasi-project |
| 38 | + ``` |
40 | 39 |
|
41 | 40 | 8. Konversi branch svn menjadi branch git |
42 | | -```shell |
43 | | -git branch -r | grep -v tags | sed -rne 's, *([^@]+)$,\1,p' | while read branch; do echo "git branch $branch $branch"; done | sh |
44 | | -``` |
| 41 | + ```bash |
| 42 | + git branch -r | grep -v tags | sed -rne 's, *([^@]+)$,\1,p' | while read branch; do echo "git branch $branch $branch"; done | sh |
| 43 | + ``` |
45 | 44 |
|
46 | 45 | 9. Konversi tag svn menjadi tag git |
47 | | -```shell |
48 | | -git branch -r | sed -rne 's, *tags/([^@]+)$,\1,p' | while read tag; do echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; done | sh |
49 | | -``` |
| 46 | + ```bash |
| 47 | + git branch -r | sed -rne 's, *tags/([^@]+)$,\1,p' | while read tag; do echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; done | sh |
| 48 | + ``` |
50 | 49 |
|
51 | 50 | 10. Konversi `svn-ignore` menjadi `gitignore` |
52 | | -```shell |
53 | | -git svn show-ignore > .gitignore |
54 | | -git add .gitignore |
55 | | -git commit -m "konversi svn ignore menjadi gitignore" |
56 | | -``` |
| 51 | + ```bash |
| 52 | + git svn show-ignore > .gitignore |
| 53 | + git add .gitignore |
| 54 | + git commit -m "konversi svn ignore menjadi gitignore" |
| 55 | + ``` |
57 | 56 |
|
58 | 57 | 11. Clone supaya bersih |
59 | | -```shell |
60 | | -cd .. |
61 | | -git clone --bare git-svn-migrasi-project nama-project.git |
62 | | -``` |
| 58 | + ```bash |
| 59 | + cd .. |
| 60 | + git clone --bare git-svn-migrasi-project nama-project.git |
| 61 | + ``` |
63 | 62 |
|
64 | 63 | 12. Copy ke server untuk disharing menggunakan Gitosis |
65 | 64 |
|
|
0 commit comments