git init -> inisialisasi git baru.
git status -> ngecek kondisi saat ini. file di stage area / udah dicommit apa blm.
git add "*.txt" -> masukin semuanya ke staging area.
git commit -m "bikin web berbasis php" -> commit smua file yg ada di stage area. trus dikasih nama
git log -> ngecek log / hasil commit
git remote add origin https://github.com/try-git/try_git.git -> bikin remote repository kosongan
git push -u origin master
-> -u ga usah ngulang lg. tgl push2. master= default local branch name.
git pull -u origin master -> ngambil dari repository.
git diff HEAD -> liad perbedaan hasil dari pull repository
git diff --staged -> liad file yg udah distage
git reset xxx.txt -> hapus.
git checkout -- xx.txt -> mengembalikan ke commit pas xx.txt ( revert to snapshot)
git branch clean_up -> bikin cabang. biar ga ganggu yg utama.
git branch -> liad isi directory
git checkout blean_up -> pindah ke cabang.
-abis pindah ke cabang bisa diapus semuanya.
git rm "*.txt"
-trus di commit
git commit -m " hapus semua isi cabang"
git checkout master -> pindah ke master.
git merge clean_up -> gabungin cabang ke repo master.
git branch -d clean_up -> hapus cabang yg bernama clean_up
git push -> commit everything
No comments:
Post a Comment