Daftar Isi
Tidak masalah protokol yang Anda gunakan untuk mengakses repositori Anda, Anda selalu perlu untuk membuat setidaknya satu repositori. Ini bisa dikerjakan dengan klien baris perintah Subversion atau dengan TortoiseSVN.
Jika Anda belum membuat repositori Subversion, inilah waktu untuk membuatnya sekarang.
You can create a repository with the FSFS backend or with the older Berkeley Database (BDB) format. The FSFS format is generally faster and easier to administer, and it works on network shares and Windows 98 without problems. The BDB format was once considered more stable simply because it has been in use for longer, but since FSFS has now been in use in the field for several years, that argument is now rather weak. Read Choosing a Data Store in the Subversion book for more information.
Buat folder kosong dengan nama SVN (contoh D:\SVN\), yang akan digunakan sebagai akar dari semua repositori Anda.
Buat folder lain MyNewRepository di dalam D:\SVN\.
Buka promp perintah (atau Kotak-DOS), ubah ke dalam D:\SVN\ dan ketik
svnadmin create --fs-type bdb MyNewRepository
atau
svnadmin create --fs-type fsfs MyNewRepository
Sekarang Anda sudah mendapatkan repositori baru ditempatkan di D:\SVN\MyNewRepository.
Buka windows explorer
Buat folder baru dan beri nama, misalnya SVNRepository
Klik-Kanan pada folder yang baru dibuat dan pilih → .
Repositori kemudian dibuat di dalam folder baru. Jangan edit file itu oleh Anda sendiri!!!. Jika Anda mendapatkan kesalahan pastikan bahwa folder kosong dan tidak dilindung tulis.
TortoiseSVN no longer offers the option to create BDB repositories, although you can still use the command line client to create them. FSFS repositories are generally easier for you to maintain, and also makes it easier for us to maintain TortoiseSVN due to compatibility issues between the different BDB versions.
Future versions of TortoiseSVN will not support file:// access to BDB repositories due to these compatibility issues, although it will of course always support this repository format when accessed via a server through the svn://, http:// or https:// protocols. For this reason, we strongly recommend that any new repository which must be accessed using file:// protocol is created as FSFS.
Of course we also recommend that you don't use file:// access at all, apart from local testing purposes. Using a server is more secure and more reliable for all but single-developer use.
Untuk mengakses repositori lokal Anda memerlukan path ke folder itu. Ingatlah bahwa Subversion mengharapkan semua path repositori dalam bentuk file:///C:/SVNRepository/. Perlu dicatat penggunaan dari garis miring maju.
Untuk mengakses repositori yang ditempatkan pada jaringan berbagi Anda bisa menggunakan pemetaan drive, atau Anda bisa menggunakan path UNC. Untuk path UNC, bentuknya adalah file://ServerName/path/to/repos/. Catatan bahwa hanya ada 2 garis miring didepannya disini.
Sebelum SVN 1.2, path UNC harus diberikan dalam bentuk lebih kabur file:///\ServerName/path/to/repos. Bentuk ini masih didukung, tapi tidak direkomendasikan.
Do not create or access a Berkeley DB repository on a network share. It cannot exist on a remote file system. Not even if you have the network drive mapped to a drive letter. If you attempt to use Berkeley DB on a network share, the results are unpredictable - you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.
Although in theory it is possible to put a FSFS repository on a network share and have multiple users access it using file:// protocol, this is most definitely not recommended. In fact we would strongly discourage it, and do not support such use.
Firstly you are giving every user direct write access to the repository, so any user could accidentally delete the entire repository or make it unusable in some other way.
Secondly not all network file sharing protocols support the locking that Subversion requires, so you may find your repository gets corrupted. It may not happen straight away, but one day two users will try to access the repository at the same time.
Thirdly the file permissions have to be set just so. You may just about get away with it on a native Windows share, but SAMBA is particularly difficult.
file:// access is intended for local, single-user access only, particularly testing and debugging. When you want to share the repository you really need to set up a proper server, and it is not nearly as difficult as you might think. Read “Akses ke Repositori” for guidelines on choosing and setting up a server.
Sebelum Anda mengimpor data Anda ke dalam repositori, pertama Anda harus memikirkan tentang bagaimana Anda ingin mengatur data Anda. Jika Anda menggunakan salah satu tata letak yang direkomendasikan nantinya akan lebih mudah.
There are some standard, recommended ways to organize a repository. Most people create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies, and a tags directory to contain tag copies. If a repository holds only one project, then often people create these top-level directories:
/trunk /branches /tags
Jika repositori berisi multipel proyek, orang sering mengindeks tata letaknya dengan cabang:
/trunk/paint /trunk/calc /branches/paint /branches/calc /tags/paint /tags/calc
...atau dengan proyek:
/paint/trunk /paint/branches /paint/tags /calc/trunk /calc/branches /calc/tags
Mengindeks dengan proyek masuk akal jika proyek tidak terkait erat dengan salah satu yang di-check out secara individu. Untuk proyek terkait dimana Anda mungkin ingin melakukan check out semua proyek dalam sekali jalan, atau dimana proyek adalah terkait semua dalam satu paket distribusi, sering lebih baik untuk diindeks dengan cabang. Dengan cara ini Anda hanya mempunyai satu trunk untuk di-checkout, dan hubungan antara sub-proyek nampak lebih mudah.
Jika Anda mengadopsi pendekatan tingkat atas /trunk /tags /branches, Anda harus mengcopy seluruh trunk untuk setiap cabang dan tag, dan dalam beberapa cara struktur ini menawarkan fleksibilitas terbanyak.
Untuk proyek tidak terkait Anda mungkin lebih ingin menggunakan repositori terpisah. Ketika Anda mengkomit perubahan, angka revisi dari seluruh repositori yang berubah, bukan angka revisi proyek. Mempunyai 2 proyek tidak terkait berbagi repositori bisa membuat ruang besar dalam angka revisi. Proyek Subversion dan TortoiseSVN nampak di alamat host yang sama, tapi sebenarnya memisahkan sepenuhnya repositori yang membolehkan pengembangan independen, dan tidak ada kebingungan pada angka pembuatan.
Tentu saja, Anda bebas untuk mengabaikan tata letak umum ini. Anda bisa membuat variasi apapun, apa saja yang bekerja terbaik bagi Anda atau tim Anda. Ingat bahwa apapun pilihan Anda, itu bukan komitmen permanen. Anda bisa mengatur ulang repositori Anda kapan saja. Karena cabang dan tag sebenarnya direktori, TortoiseSVN bisa memindahkan atau mengganti namanya sesuai yang Anda inginkan.
Menukar dari satu tata letak ke lainnya hanyalah masalah menerbitkan seri perpindahan dari sisi-server; Jika Anda tidak menyukai cara kerja yang diatur dalam repositori, aturlah kembali direktori.
So if you haven't already created a basic folder structure inside your repository you should do that now. There are two ways to achieve this. If you simply want to create a /trunk /tags /branches structure, you can use the repository browser to create the three folders (in three separate commits). If you want to create a deeper hierarchy then it is simpler to create a folder structure on disk first and import it in a single commit, like this:
buat folder kosong baru pada hard disk Anda
buat struktur folder tingkat-atas yang Anda inginkan, di dalam folder itu - jangan simpan dulu file apapun!
impor struktur ini ke dalam repositori via klik kanan pada folder dan pilih → Ini akan menanyakan folder temp ke dalam akar repositori untuk membuat tata letak repositori dasar.
Catatan bahwa nama folder yang Anda impor tidak nampak dalam repositori, hanya isinya saja. Sebagai contoh, buat struktur folder berikut:
C:\Temp\New\trunk C:\Temp\New\branches C:\Temp\New\tags
Impor C:\Temp\New ke dalam akar repositori, yang akan nampak seperti ini:
/trunk /branches /tags