Git入門 常用的git指令

2021-10-03 02:45:09 字數 841 閱讀 4920

git常用的指令:

如果只需要掌握基本應用,瀏覽以下廖學峰的git教程就可以了

跳轉☞廖雪峰git教程

這是我自己學習過程中覺得常用的一些指令;

git config --global user.name 」」

git config --global user.email 「」

mkdir +資料夾

cd +資料夾

pwd 輸出資料夾路徑

git init 初始化乙個空版本

git add +檔案

git commit -m 「 tips」

git status 檢視狀態和結果

git log 顯示從最近到最遠的提交日誌

git reset –hard head^從當前版本回退到上乙個版本

git cat+檔案 顯示檔案內容

git reflog 可以記錄每一次的命令

git diff head – 檔名

git checkout – 檔案 撤銷修改,返回最近一次使用git commit或git add的狀態。

從版本庫里刪除某個檔案:

Git 常用指令

首先需要建立乙個repo,這是cd到資料夾底下,然後init。git init 在檔案系統裡面的檔案如果不新增到git的repo裡面,不會自動被git辨識,需要手動新增,這也是初始化repo是必須要做的事。git add documentation txt git add git sh 刪除檔案,分...

git常用指令

git 常用命令 git init here 建立本地倉庫 repository 將會在資料夾下建立乙個 git 資料夾,git 資料夾裡儲存了所有的版本資訊 標記等內容 git remote add origin git github.com winter1991 helloworld.git 把...

git常用指令

git config global user.name robbin git config global user.email fankai gmail.com git config global color.ui true git config global alias.co checkout g...