Khởi tạo Github dưới local

1. Tạo tài khoản github và tạo mới 1 Repositories

github_2016_04_24_001

Giao diện tạo mới:

github_2016_04_24_002

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

github_2016_04_24_004

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

github_2016_04_24_003

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)

github_2016_04_24_006

– Giao diện github sau khi khởi tạo

github_2016_04_24_0053. 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 ^_^