隨便記些常用的git命令

2022-09-09 19:00:26 字數 525 閱讀 5192

git提交**

git add . 提交暫存區

git status 檢視有變更的檔案

git commit -m "注釋"

git push 提交遠端倉庫

git pull 刷回最新**

git分支管理

git branch 檢視本地所有分支

git branch -r 檢視遠端所有分支

git branch -a 檢視所有分支

git merge 【待合併分支】 將某分支合併到master

git push origin master 將合併後的**推送到遠端分支

git版本回滾

git checkout 檢查當前分支

git checkout [file] 恢復暫存區檔案

git log 檢視提交版本

git revert 【版本號】 將本地庫回滾到該版本號之前的版本(即撤回該版本及之後的提交)

記 我的git常用命令

解決there is no tracking information for the current branch.please specify which branch you want to merge with 指定本地master到遠端的master,然後再去pull git branch ...

GIT常用的一些命令

整理一些git常用的命令,都是非常實用的命令 git clone git倉庫位址 proj name 將git倉庫 轉殖到本地,後面可以加工程名,重新命名工程 不建議加 git branch 檢視本地倉庫下有哪些分支 git branch d 分支名 刪除本地分支 git remote v 檢視遠端...

一些常用的git命令

cd 盤名 資料夾名 進入d盤資料夾 mkdir 資料夾名稱 建立乙個資料夾 git config global user.name username 建立使用者名稱和密碼 git config global user.email email git config list 檢視git配置 cat ...