Learn Git GitHub Codecademy

50.000

Category:

Learn Git GitHub Codecademy

Add your review
Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare

Learn Git GitHub Codecademy

Learn Git GitHub Codecademy

fff

Learn Git GitHub Codecademy

fff

Learn Git GitHub Codecademy

fff

Learn Git GitHub Codecademy

fff

Learn Git GitHub Codecademy

fff

Nguyen Minh Hung Minhung

code cademy


BASIC GIT WORKFLOW

#LearnGit£GitHub #Partl

Git init

Bây giờ chúng ta bắt đầu làm việc vói kịch bản, hãy biến thư mục chứa file scene-l.txt trở thành một Git project bằng lệnh:

  • • • •

git init

Từ init mang ý nghĩa là initialize – khởi tạo. Câu lệnh sẽ thiết lộp các tool cần thiết mà Git cần để theo dõi những thay đổi của thư mục project.

Learn Git GitHub Codecademy Để ý output trong terminal khỉ khởi tạo một Git project

  • • • •

holden@MSI:~/l.ab$ git init

Initialized empty Git repository in /homc/holdcn/lab/.gvt/ holden@MSI:~/lab$

sê CÓ một thư mục .git/ được tạo trong thư mục project.

^^^^^^^^^^^^^^^^^^^^^^^^^^^■3

Git Workflow

Nai xừ! chúng ta đã có một Git project. Một Git project có thể hình dung gồm ba phần:

  • 1. A Working Directory: Learn Git GitHub Codecademy thư mục mà bạn sẽ thực hiện mọi công việc như tạo, chỉnh sửa, xóa và quàn lý file.

  • 2. A Staging Area: nơi bạn liệt kê những thay đổi đã thực hiện ở working directory.

  • 3. A Repository: nơi Git lưu những thay đổi trên thành các phiên bàn (version) khác nhau của project.

Basic Git Workflow

<<<123>>>

o

git Init -—

–>


git add


Working Directory


Make d’anges to files;

  • • Additions__________

  • • Celclmris




Staging Area Files die ready fur coirirr-il



Repository

c ranges d-e saved .□ repository as a corrmit


• Modifications

Git Status

Khi viết tiếp kịch bản ở ví dụ trưóc, bạn sẽ thay đổi nội dung của thư mục làm việc Learn Git GitHub Codecademy (working directory). Bọn có thể kiểm tra trạng thái của những thay đổi đó với

git status

Từ terminal, thử kiểm tra trạng thái của project ví dụ. Để ý nội dung output, nhân thấy những file có tên màu đỏ dưỏi phần Untracked files. Untracked mang ý nghĩa Git biết những file có thay đổi nhưng chưa tiến hành theo dõi (tracking)

• • •

holden@MSI:~/lab$ git status

On branch master

No cumiiils ye I Learn Git GitHub Codecademy

Un tracked files:

(use "git add <file>…" to include in what will be committed)

nothing added to commit but untracked files present (use "git add" to track) holden@HSI:~/lab$

Git Add

Để Git bắt đầu tracking file scene-l.txt trong ví dụ, file đó cần được thêm (add) vào staging area

git add [filename]

[filename] sẽ là tên của file bạn đang chỉnh Learn Git GitHub Codecademy sửa, ví dụ như scene-l.txt.

Sau khi thêm scene-l.txt vào staging are trong Git. Kiểm tra lại trạng thái Git project vói git status. Để ý output phần Changes to be commited, Git thông báo file đã được thêm vào staging area (tên màu xanh lá)

• • •

holden@MSl:~/lab$ git add scene-l.txt holden(cHSI :~/lab$ git status On branch master

No commits yet Learn Git GitHub Codecademy

Changes to be committed:

(use "git rm –cached <file>…" to unstage) new file: scene-l.txt

holden@MSI:~/lab$

Next ->

0

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “Learn Git GitHub Codecademy”

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Learn Git GitHub Codecademy
Learn Git GitHub Codecademy
Kho Thư Viện
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart