###### tags:`ALPHACampWeek8_學期2-2` github操作 === git init --- - 登陸專案 git status --- * 查看狀態 git add --- - Unstage -> Stage ``` [~/git-demo] $ git add index.html [~/git-demo] $ git add . ``` git commit --- - 提交註解後最終程式碼 ``` [~/git-demo] $ git commit --message "Initialize Project" //第二種簡略寫法 [~/git-demo] $ git commit -m "Initialize Project" ``` git log --- * 查看歷史 * 可以使用參數oneligne將每筆 commit 整合成一行 ``` [~/git-demo] $ git log --oneline ``` git diff --- - 對照差異 - 可用兩個COMMIT參數來對比 ``` [~/git-demo] $ git diff <sha1> <sha1> ``` git revert reset rebase --- * revert:刪除操作並複製一個commit * reset:刪除commit * rebase:整合commit  git遠端操作第一次操作 --- git remote add origin https://github.com/ks0dcongra/git_AC.git git branch -M main git push -u origin main(第一次設定) * git remote -v 查看遠端 * git remote remove origin 刪除主機 * git push 之後推究用這樣就好 How to write Readme --- Project Title Installation Features How to use API Reference License pwd --- - 現在所在位置 ls --- ``` ls -l:用列表方式印出詳細清單 ls -a:列出包含隱藏檔案的檔案項目 ls -la:用列表方式,印出包含隱藏檔案的詳細清單 ``` mkdir --- 新增資料夾 code --- 透過編輯器打開檔案 rm --- 刪除檔案 * 刪除資料夾 ``` rm -rf ``` cp --- 需要輸入兩個參數,指定檔名的e話會直接建立一個複製品 1. 你想要複製的檔案,與 2. 複製出的檔案 mv --- 跟cp很像,功能包括:移動檔案&&修改檔名 grep --- 尋找關鍵字, ``` ls | grep 'html' ``` cat(concatenate) --- 預覽檔案內容
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up