1. Tạo tài khoản github và tạo mới 1 Repositories
Giao diện tạo mới:
2. Khởi tạo GIT dưới local (nếu chưa check “Initialize this repository with a README”)
– Giao diện github khi tạo mới chưa check “Initialize this repository with a README”
– mkdir www/tutorial : Tạo thư mục tutorial
– cd www/tutorial : Di chuyển đến thư muc cần chứa source git
– echo “# turorial” >> README.md : Tạo file README.md với nội dung “# tutorial”
– git init : Khởi tạo empty git
– git add README.md : Thêm file README.md vào git (local)
– git commit -m “Fisrt commit” : Commit những file thay đổi vào git (local) với tiêu đề “First commit”
– git remote add origin git@github.com:beocon/tutorial.git : Thêm remote url cho git (local)
– git push -u origin master : Push file đã commited to git (remote)
– Giao diện github sau khi khởi tạo
3. Khởi tạo GIT dùng git clone (nếu đã check “Initialize this repository with a README”)
– cd www : Di chuyển đến thư muc cần chứa source git
– git clone git@github.com:beocon/tutorial.git tutorial : Clone repository về máy local với tên thư mục là tutorial, nếu không khai báo tên thư mục, git sẽ lấy tên repository (remote) làm tên thư mục.
Done ^_^