Git 狀況劇


Posted by tzutzu858 on 2020-06-21

想改 commit message

git commit --amend會進到vim裡去改


我 commit 了可是我又不想 commit 了

git reset HEAD^ 預設值是--mixed回到沒有 commit 狀態,沒有git add,檔案所修改的內容都還在
git reset HEAD^ --hard 回到上一版,檔案也回到上一版的內容
git reset HEAD^ --soft 回到沒有 commit 狀態,但有git add,檔案所修改的內容都還在


我還沒 commit,但我改的東西我不想要了

git checkout --<檔案名>檔案就會回到之前狀態
git checkout -- .所有檔案都會回到之前狀態


改 branch 的名字

git branch -m <新branch名>


抓遠端的 branch

git checkout <遠端 branch 名稱>就會自動把你抓下來,並且切到剛剛所打的 branch


取 remote name 作用


#Git







Related Posts

後端資料庫欄位型態與實作 Cookie

後端資料庫欄位型態與實作 Cookie

初學者好好用 Chrome 開發者工具

初學者好好用 Chrome 開發者工具

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 1)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段四:個人專案~Sprint 1)


Comments