高見龍為自己學 git 學習筆記-ep1
一些簡單的基本:終端機指令
- 複製檔案
cp - 重新命名檔案
mv '舊檔名' ‘新檔名‘ - 列出目前位置
pwd - 移除檔案
rm - 到根資料夾
cd ~ - 顯示所有包括隱藏的檔案
ls -al
Vim操作

git 基本操作
- 使用者基本資料設定(bt device),設定姓名/電子郵件
1 | git config --global user.name "Eddie Kao" |
- 這邊拿掉global 的話就會對專案直接做個別設定
- 存取的global使用者資料會在user根資料夾底下的.gitconfig檔案裡
1
~/.gitconfig
列出當前使用者資料設定
1
git config --list
其實可以把git的預設編輯器改成 VSCODE
https://stackoverflow.com/questions/30024353/how-to-use-visual-studio-code-as-default-editor-for-gitgit 的操作指令其實也可以寫alias(縮寫)
1 | git config --global alias.co checkout |
1 | git config --global alias.l "log--oneline--graph" |
1 | git config --global alias.ls 'log --graph --pretty=format:"%h <%an> %ar %s"' |
專案git初始化的流程
cd <folder>git init
git add --all
1 | git add -A stages all changes |
git commit -m <commit log>