Oktober 02, 2012

Git dan Github: Petunjuk Awal

Mengambil dari repo
  • git clone [lokasi]
Contoh:
  • git clone https://github.com/bpdp/buku-cloud-nodejs.git (jika menggunakan https)
  • git clone git://github.com/bpdp/buku-cloud-nodejs.git (jika menggunakan git)
Membuat repo baru di lokal
  • Buat direktori baru
  • Masuk ke direktori baru tersebut
  • Menambahkan semua file:
    • git add -A
  • Commit:
    • git commit -m "First commit - initializing empty repo"
Melihat status repo lokal
    • git status
File baru di repo
  • Menambahkan file
    • git add [file]
  • Commit:
    • git commit -m "Menambahkan file untuk ..."
  • push ke github
Mengedit file
  • Edit file
  • Commit:
    • git commit -m "Pesan"
  • push ke github
Push ke github
  • Menetapkan repo:
    • git remote add origin
      • contoh: git remote add origin https://github.com/bpdp/buku-cloud-nodejs.git
  • Push:
    • git push origin master