Created
March 20, 2012 17:02
-
-
Save masasdani/2138234 to your computer and use it in GitHub Desktop.
membangun public git repository di ubuntu (jalur ssh)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install git | |
$ sudo apt-get -y install git-core gitosis | |
#meng inisialisasikan gitosis menggunakan key kita. | |
$ sudo -H -u gitosis gitosis-init < /home/badak/.ssh/id_rsa.pub | |
#key harus berupa .pub apabila di dalam folder .ssh kita belum ada, bisa digenerate menggunakan ssh-keygen | |
$ ssh-keygen -t rsa -C "[email protected]" | |
#clone gitosis-admin confoguration | |
$ git clone [email protected]:gitosis-admin.git | |
#edit setting dari ssh | |
$ sudo nano /etc/ssh/sshd_config | |
#tambahkan baris | |
AllowUsers gitosis | |
#masuk ke directory gitosis admin yang tadi di commit | |
$ cd gitosis-admin | |
#untuk menambah repository edit file gitosis.conf | |
$ nano gitosis.conf | |
#ubah seperti dibawah ini | |
/**** | |
[gitosis] | |
[group team] | |
writable = projectbaru | |
members = [email protected] | |
[group gitosis-admin] | |
writable = gitosis-admin | |
members = [email protected] | |
*****/ | |
#untuk memastikan members diatas, cek di folder keydir. copy nama file nya tanpa .pub | |
#lakukan commit | |
$ git commit -a -m "edit" | |
#push hasil editan | |
$ git push | |
#buat project baru, atau masuk ke directory project yang sudah ada | |
$ cd projectbaru | |
$ git init | |
$ git add . | |
$ git commit -a -m "initial commit" | |
$ git remote add origin [email protected]:testproject.git | |
$ git push origin master | |
#seharusnya project sudah jadi. dan bisa di clone oleh orang lain. | |
$ git clone [email protected]:testproject.git | |
#untuk menambah member, edit file gitosis.conf dari folder gitosis-admin tadi, masukkan file .pub milik teman kamu di folder keydir setelah di rename sesuai email. | |
$ cd gitosis-admin | |
$ cp ~/kakashi.pub keydir/ | |
$ cp ~/naruto.pub keydir/ | |
$ git add keydir/kakashi.pub keydir/naruto.pub | |
# edit file gitosis.conf | |
[group team] | |
writable = testproject | |
members = hostname.yourserver.com [email protected] [email protected] | |
#lakukan commit | |
git commit -a -m "memberikan hak komit pada kakashi dan naruto" | |
git push | |
#selesai |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment