Git merge
Git rebase
Git commit
Git revert
Git add
Git checkout
Git head~
Git diff

Lệnh git fetch

Lệnh git fetch tải về dữ liệu từ Remote Repo (các dữ liệu như các commit, các file, refs), dữ liệu tải về để bạn theo dõi sự thay đổi của remote, tuy nhiên tải về bằng git fetch nó chưa tích hợp thay đổi ngay local repository của bạn, mục đích để theo dõi các commit người khác đã cập nhật lên server, để có được thông thông tin khác nhau giữa remote và local

Tải về thông tin của tất cả các nhánh của remote có tên origin

git fetch origin
Hoặc

git fetch –all
Tải thông tin của một nhánh, ví dụ master của remote origin

git fetch origin master
Sau khi tải về, để có thể khám phá sự khác biệt giữa local và remote bạn có thể xem trạng thái của thư mục làm việc, xem log của một nhánh local và log của nhánh remote

Ví dụ xem log nhánh master của remote origin

git log –oneline origin/master
Sau khi kiểm tra sự khác biệt của nhánh giữa remote và local, bản có thể thay đổi cập nhật vào local repo dữ liệu tải về bằng lệnh git pull hoặc git merge, ví dụ gộp thay đổi của remote/master và master bằng merge thì thi hành

git merge origin/master

Lệnh git pull

Lệnh git pull lấy về thông tin từ remote và cập nhật vào các nhánh của local repo.

Thi hành lệnh:

git pull
Hoặc chỉ rõ remote

git pull origin
Thì nó tải về thông tin và ngay lập tức merge cho nhánh đang làm việc, nó tương đương với lệnh

git fetch origin
git merge origin/master
Bạn có thể viết lại lịch sử commit của nhánh đang làm việc, cập nhật toàn bộ nhánh remote là base của nó thì thực hiện

git pull –rebase origin

Enable Git Tab Autocomplete for Zsh MacOs

#edit .zshrc
nvim ~/.zshrc
#Add following code
autoload -Uz compinit && compinit
# source
source ~/.zshrc

# REF
https://www.macinstruct.com/tutorials/how-to-enable-git-tab-autocomplete-on-your-mac/

Bài viết khác

Build for global scale: AFK scale cube and basic rule to build an application for global scale

REF https://akfpartners.com/growth-blog/scale-cube

PostgreSQL : subquery, CTE

What is subquery in PostgreSQL? In PostgreSQL, a subquery is a query that is nested inside another query. The subquery is executed first, and its results are used as input to the outer query. Subqueries can be used in various contexts, such as in the SELECT, WHERE, and HAVING clauses of a query. For example, […]

Optimize SQL : rule and todo list

Some rule and todo list to Optimize SQL REF https://www.pgmustard.com/blog/indexing-best-practices-postgresql

PostgreSQL Compound indexes

What is Compound indexes in PostgreSQL? A compound index (also known as a composite index or a multi-column index) refers to an index that is created on two or more columns of a table. It allows PostgreSQL to quickly find rows that match a query condition based on the values in multiple columns, which can […]

Use AWS to deploy your applications and services

Amazon Web Services (AWS) is a cloud computing platform that provides a wide range of services to help businesses and individuals build and deploy applications in the cloud. AWS offers a variety of services such as compute, storage, databases, networking, security, and more. In this guide, we will walk through the steps to get started […]

Use docker to run go project

Docker is a powerful tool that enables developers to create, deploy and run applications in a containerized environment. Using Docker to run Go projects has many advantages, including the ability to isolate your application from the underlying operating system, simplifying the deployment process, and allowing for greater scalability and flexibility. In this guide, we will […]