git命令使用筆記1

2021-09-25 09:21:11 字數 723 閱讀 7996

列舉使用到的一些git命令。

作用

命令顯示某次提交的修改內容

git show

顯示某次提交的某個檔案的修改內容

git show 《檔案》

顯示以前每一次提交的修改內容

git log -p 《檔案》

顯示n次前提交的修改內容

git log -p -n 《檔案》

恢復到某個檔案的狀態git checkout 《檔案》

比較某個檔案的兩個歷史記錄git diff 《檔案》

取消合併操作

git merge --abort

將當前內容暫存到快取區

git stash

將快取區內容取出git stash pop

GIT命令使用筆記

git init 初始化git add 新增到暫存區 新增所有 新增資料夾 git commit 提交 a 自動將在提交前將已記錄 修改的檔案放入快取區 m新增提交說明 git clone 轉殖版本庫 git pull 拉回遠端版本庫的提交 git push 推送至遠端版本庫 git fetch 獲...

git 使用筆記

git 使用筆記 初始化資訊 git config user.name name git config user.email com git config core.editor vim git init 初始化資訊 從遠端pull git clone git url git pull push 到...

git使用筆記

回滾 git checkout sql 沒有 git add 之前 執行回滾到原始狀態 git reset head sql 執行git add之後,但是沒有 git commit之前 操作,然後在執行 git checkout git remote v 檢視遠端倉庫詳細資訊 git log log...