Explore Ebooks
Categories
Explore Audiobooks
Categories
Explore Magazines
Categories
Explore Documents
Categories
Karedok Karedok
* Ketimun * Ketimun, direbus sebentar
* Tauge * Tauge
* Kol * Kol, iris halus
* Kacang panjang * Kacang panjang, rebus sebentar
* Daun kemangi * Daun kemangi
* Terong * Terong
Contoh: Subversion, Bazaar, Mercurial, Git
1. Buat repositori
2. Salin revisi
3. Ubah, tambah, hapus
4. Kirim perubahan ke repositori
2 3
1 4
Terpusat vs Terdistribusi
Repositori Utama
Repositori
Repositori Pribadi
Direktori Kerja
Direktori Kerja
Alur Kerja Tambahan
Salin repositori
Kirim perubahan ke repositori lain
git init
Membuat repositori baru
$ mkdir resep
$ cd resep
$ git init
Initialized empty Git repository in /home/iang/resep/.git/
$ ls -a
. .. .git
git add
Mendaftarkan berkas untuk disimpan
$ vi karedok.txt
$ git add karedok.txt
git commit
Menyimpan perubahan ke repositori
Staging Area
Berisi perubahan yang akan disimpan pada
saat commit
Berguna untuk commit secara selektif
Git Philosophy
Commit early, commit often
One commit represents one idea or one
change.
Your working directory, index, and local
repo are your scratch pads.
Advanced Git Tutorial by Sarah Sharp
http://thesharps.us/~sarah/advanced-git.pdf
git add
Menambahkan berkas baru
Menyimpan perubahan ke staging area
$ vi karedok.txt
$ git commit -m "tambah petunjuk"
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: karedok.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git add karedok.txt
$ git commit -m "tambah petunjuk"
[master 84801e1] tambah petunjuk
1 files changed, 3 insertions(+), 3 deletions(-)
Ilustrasi Staging Area
kondisi sebelum git add
Kolaborasi
1. Menyalin repositori
2. Membuat perubahan lokal
3. Mengirim perubahan ke repositori lain
git clone
Menyalin repositori
$ ls
webwml-id
git log
Melihat riwayat perubahan
$ git log
commit 9d014350974f00670b1c694fb71d72037e677f9a
Author: Izharul Haq <atoz@debian-id.org>
Date: Fri Dec 3 06:55:58 2010 +0700
commit 3fd26492e4feeb1ee835e8261b66aa5975d99074
Author: Izharul Haq <atoz@debian-id.org>
Date: Thu Dec 2 19:07:36 2010 +0700
commit c3dbd03a7947cc0feefe658dbe57f757358eeba1
Author: Izharul Haq <atoz@debian-id.org>
Date: Thu Dec 2 18:47:46 2010 +0700
Initial translations
...
git remote
Repositori lain yang dipakai
$ git remote
origin
git push
Mengirim perubahan ke repositori lain