GitHub là gì?


HTML

GitHub là một nền tảng lưu trữ mã để cộng tác và kiểm soát phiên bản.

GitHub cho phép bạn (và những người khác) làm việc cùng nhau trong các dự án.


Đăng ký GitHub tại https://github.com/:

GitHub

Các yếu tố cơ bản của GitHub là:

  • Kho lưu trữ
  • Chi nhánh
  • Cam kết
  • Yêu cầu kéo
  • Git (phần mềm kiểm soát phiên bản GitHub được xây dựng trên)

Thí dụ

$ git push origin heroku
$ cd /etc/
$ ls

Kho

Một kho lưu trữ GitHub có thể được sử dụng để lưu trữ một dự án phát triển .

Nó có thể chứa các thư mục và bất kỳ loại tệp nào (HTML, CSS, JavaScript, Tài liệu, Dữ liệu, Hình ảnh).

Kho lưu trữ GitHub cũng phải bao gồm tệp giấy phép và tệp README về dự án.

Một kho lưu trữ GitHub cũng có thể được sử dụng để lưu trữ các ý tưởng hoặc bất kỳ tài nguyên nào mà bạn muốn chia sẻ.


Ngành

A GitHub branch is used to work with different versions of a repository at the same time.

By default a repository has a master branch (a production branch).

Any other branch is a copy of the master branch (as it was at a point in time).

New Branches are for bug fixes and feature work separate from the master branch. When changes are ready, they can be merged into the master branch. If you make changes to the master branch while working on a new branch, these updates can be pulled in.


Commits

At GitHub, changes are called commits.

Each commit (change) has a description explaining why a change was made.


Pull Requests

Pull Requests are the heart of GitHub collaboration.

With a pull request you are proposing that your changes should be merged (pulled in) with the master.

Pull requests show content differences, changes, additions, and subtractions in colors (green and red).

As soon as you have a commit, you can open a pull request and start a discussion, even before the code is finished.

A a great way to learn GitHub, before working on larger projects, is to open pull requests in your own repository and merge them yourself.

You merge any changes into the master by clicking a "Merge pull request" button.

GitHub

After merging you can delete the branch by clicking a "Delete branch button".

GitHub