git 常用命令

2021-08-21 22:12:02 字數 1030 閱讀 2751

git是乙個開源的分布式版本控制系統,可以有效、高速的處理從很小到非常大的專案版本管理,一般我們開發都會用到git svn這些版本控制和**管理的同步工具 因為以前用的svn,git初次使用 以此記錄常用命令

git clone 轉殖**到本地

git diff +檔名 對比自己的檔案和線上的檔案有哪些不一樣

git pull 下拉**

git branch 檢視分支資訊

git checkout +分支名 切換到某一分支

git checkout -b test //新建test分支

git checkout -d test //刪除test分支

git add . 提交所有檔案

git add 檔名 提交單個檔案

git commit -m "注釋" 把**提交到本地庫

gut push origin master 把本地**推送到遠端倉庫

//拉取指定分支**

git clone -b branchname ***

其中branchname 就是分支的名稱

如何覆蓋更新

git fetch --all

git reset --hard origin/master

1.在碼雲新建倉庫 複製倉庫位址

2.進入專案目錄執行如下**

git init

git remote add origin ***xx.git

git pull origin master

git add .

git commit -m "第一次提交"

git push origin master

//報錯的話忽略git 庫中的 檔案 執行下邊的語句

git push origin master -f

常用命令 Git 常用命令大全

安裝教程可參照 廖雪峰老師的安裝教程。git config 在git中,使用git config 命令來配置 git 的配置檔案,git配置級別主要有3類 1 倉庫級別 local 本地 git 倉庫級別配置檔案,作用於當前倉庫。優先順序最高 2 使用者級別 global,全域性配置檔案,作用於所有...

git 常用命令

檢視是否存在檔案需要上傳 git status git add git commit m 建立遠端倉庫 git remote add origin 116.255.146.153 ruby cd work daily project.git 更新git fetch 116.255.146.153 r...

git常用命令

詳細 1,git log p 命令來顯示每一次提交與其父節點提交內容之間快照的差異。2,為了檢視載入 staged 而並未提交 not committed 的內容差異,可以使用 git diff stage 命令 在git 1.6之前的版本中,使用 cached 適應情形 在執行git commit...