---
# System prepended metadata

title: <筆記>十分鐘學會正確的github工作流
tags: [git, github]

---

# <筆記>十分鐘學會正確的github工作流
ref: https://www.youtube.com/watch?v=uj8hjLyEBmU
## 1.先clone一份下來
![image](https://hackmd.io/_uploads/rJiDCnHf0.png)

## 2.建立一個分支(checkout -b branch)
![image](https://hackmd.io/_uploads/HJb3CnHzC.png)

## 3.開發程式(變更內容)
## 4.檢查差異(diff)
![image](https://hackmd.io/_uploads/SkCzJaSzC.png)

## 5.新增暫存(add)
![image](https://hackmd.io/_uploads/B1jrk6rfR.png)

## 6.git commit
![image](https://hackmd.io/_uploads/rJYdJprG0.png)

## 7.repo push branch
![image](https://hackmd.io/_uploads/Bknjy6HfC.png)

## 8.更新原main內容(別人更新的做同步過來)
git checkout main
git pull origin master
![image](https://hackmd.io/_uploads/B1tHxaSGR.png)

![image](https://hackmd.io/_uploads/SyxBOl6BzC.png)

## 9. local 更新自己的分支 (checkout 、rebase)
![image](https://hackmd.io/_uploads/r1o2gaBzC.png)

![image](https://hackmd.io/_uploads/S1OMW6BGR.png)

## 10. repo 更新自己的分支 (push)
![image](https://hackmd.io/_uploads/SJxr-TBfA.png)

## 11. new pull request
![image](https://hackmd.io/_uploads/SJGOmTSM0.png)

![image](https://hackmd.io/_uploads/rJDi7Trz0.png)

![image](https://hackmd.io/_uploads/H1VeETrzR.png)

![image](https://hackmd.io/_uploads/rkMvV6BfC.png)

![image](https://hackmd.io/_uploads/Sy5_EaHfC.png)

![image](https://hackmd.io/_uploads/rJroEaBMR.png)





