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 基礎實戰演練
CSST 程式設計討論會 2023
Author: Sean 韋詠祥
Note:
日期:2023-05-10(三)
時間:19:00 - 21:00
TODO:
webserver .git/config
merge conflict
git reflog
reflog game
git commit
git tag
gui
git blame
講者介紹
課前準備
安裝 Git 工具
macOS 安裝方式
先開啟 iTerm2 或 Terminal 終端機
輸入 git 指令,內建的 Xcode 將會跳出安裝資訊
Windows 安裝方式
搜尋 Git for Windows
Link: https://gitforwindows.org/
依指示安裝
基本上都下一步,編輯器這邊可以改成自己慣用的

Linux 安裝方式
相信你知道怎麼做的 :D
註冊 GitHub 帳號
網站:https://github.com/
基本 Linux 指令
先大概理解就好,也可以上網查「Bash XXX 用法」
Note:
2022/11/02
上學期教過初探 Linux
Linux 指令 Part 1
Note:
知道在哪、探索、移動
Linux 指令 Part 2
Linux 指令 Part 3
在開始之前,你有沒有看過…
什麼是版本控制?
傳統中央控管型
分散式版本控制系統
Note:
對 Git 來說,支援分岔
Git 核心使用概念
開始使用 Git
環境設定
環境設定(續)
Note:
Removed
建立第一個本地 Repo
Git Repository
稍微改點東西
先用編輯器打開
main.py
檔案用
for
跟range()
讓他輸出 0 到 4 這五個數字,每次換行
完成後用 git 保存版本紀錄
Note:
先講 status
下頁講 diff
再來是 show
需求變更
輸入:一個正整數 N
輸出:從 0 到 N-1 的數字,每次換行
Hint:用
int(input())
接收輸入Note:
剛講 status
現在是 diff
下頁講 show
再次修改
輸入:一個正整數 N
輸出:從 1 到 N 的數字,每次換行
試著查看歷史紀錄
Note:
講完 status、diff
這頁講 show
.gitignore
別把我的黑歷史記下來 (/ω\)
使用情境
當我們有個不必要的檔案
設定方式
補充:事後刪除敏感資料
假如我們要從 git 歷史中
完整刪除
pkg/
底下所有.deb
檔案參閱:凍仁的筆記(2014)
建立 GitHub Repo
設定遠端 Repo 網址
加入說明檔案
LICENSE 授權條款
完成!
讓我們進到 Git 進階用法
Git-flow
Git Branch
小練習:
輸入前詢問「Input N: 」
輸出 0 到 N-1
Git Push
Git Restore
Git Stash
Git Rebase
Git Reflog
救回被 rebase 到不見的檔案
Demo: Sea-n/my-python-project
Note:
找 secret
測試 rebase 後 reflog
提醒 working area / staging / git
學習資源
Learn Git Branching Challenge
網址:https://learngitbranching.js.org/
Thanks
投影片連結:https://hackmd.io/@Sean64/git-csst2023
這份投影片以 創用 CC - 姓名標示 授權公眾使用,原始碼及講稿請見 此連結。