or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
擁抱 Git CLI
ToC
為什麼要用 CLI
Pros:
git log --grep 'some message'
Cons:
概念
日常操作,僅需熟悉以下七個指令就已足夠
git branch my-branch
git checkout my-branch
git add -p
git commit -m"first commit"
git fetch origin develop
git rebase origin/develop
git push origin my-branch
檔案狀態
每個檔案都有三個對應的狀態:
checkout 用來切換紀錄
branch / tag 都只是 SHA1 的別名
只要有 git 就一定會處於 HEAD ,任何變更都會影響到當前的 HEAD
HEAD -> 9afc5562
HEAD -> feature/sticky-table-ernest -> 9afc5562
操作都是在 HEAD 指向的紀錄上執行
HEAD 沒有指向任何分支,此時 Commit 一筆紀錄,僅 HEAD 自己會指到新的 SHA1,而其他分支不會影響
HEAD 指向某一分支,此時 Commit 一筆紀錄,HEAD、分支都會跟著指到新的 SHA1
接力
總結
遇到困難怎麼辦?
直接找官方文件是最周全的方式:
the Git Book
此外也可以利用以下指令查詢:
git help
git help tutorial
git help everyday
搭配視覺化的練習網站
參考來源