Skip to content

Embedded0909/GITHUB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Phần 01 Git config

Set config

git config --global user.name "Name"
git config --global user.email "Email"

Get config

git config --global user.name
git config --global user.email

Phần 02 Creating repo/ Cloning repo

git init
git remote add origin git_url
git remote -v
git clone git_url
git pull origin master
git push origin master

Phần 03 Staging

Check status

git status

To add a file to staging area

git add FILE_NAME

To remove a file from staging area

git rm --cached FILE_NAME

To add all file to staging area

git add .

Phần 04 Committing

To show all the commits with detail

git log

To show all(n) the commits in one line

git log --oneline
git log --oneline -n

To commit

git commit -m "comment"

Phần 05 Git stash

#. Đang code dở file main.cpp
#. Cần chuyển sang nhánh khác để sửa bug gấp

Lưu vào stash

git stash save -m "comment"

Lấy ra toàn bộ stash

git stash list

Khôi phục stash gần nhất và xóa khỏi danh sách

git stash pop

Khôi phục stash gần nhất nhưng không xóa khỏi danh sách

git stash apply

Xóa một stash

git stash drop stash@{0}

Xóa mọi stash

Xóa tất cả stash

Phần 06 Git ignore

Ex:
.env
/Folder
*.txt

Phần 07 Reverting & Reset

Phần 08 Branch

Phần 09 Merging branch

Phần 10 Git rebase

About

Learn to github

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages