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
7.1 0423 Git 基礎
Linus Torvalds
目前最多人使用的分散式版本控制系統
常用Terminal指令
iTerm2: https://www.iterm2.com/
Q: 爲什麼要學指令?
A: 有些指令在GUI找不到
重點:要在對的地方(資料夾/目錄)下對的指令!
pwd (print working directory)
印出目前的工作資料夾
新增資料夾:mkdir (make directory)
建立新的資料夾
cd 資料夾名稱 (change directory)
改變資料夾目錄
新增檔案:touch
建立檔案
ls -al (list all)
列出資料夾下的所有檔案
再touch一次同檔名的檔案:改變時間戳記
cd ..
回到上一層目錄
刪除檔案: rm (remove)
刪除檔案
刪除資料夾: rm -r
刪除資料夾
複製: cp (copy)
複製檔案並改檔名
移動/更改檔名: mv (move)
git安裝
網址: https://git-scm.com/
git 的GUI軟體(Graphical User Interface, 圖形使用者介面)
https://www.sourcetreeapp.com/
git –version
git設定
git config –list
檢視基本資料
設定基本資料
git config --global
user.namegit config --global
user.emailgit init
初始化
git 狀態
git status
查詢 Git 狀態
git 的三個狀態
working 工作目錄
git add
: working到stagingstaging 暫存區域
git commit
-m
: staging到repositoryQ: 為什麼要add/commit 兩段式?
A: 堆了一批貨再進倉庫(要留下有意義的註記)
repository 儲存庫
git push
: repository本地到遠端git pull
: repository遠端到本地檢視 git 記錄
git log
: 列出最近commit過的記錄git log
--oneline
: 列出一行記錄