git基本命令

2021-08-20 00:14:10 字數 816 閱讀 5016

轉殖遠端倉庫:git clone  url

檢視分支:git branch

建立分支:git branch

切換分支:git branch

建立並切換分支:git branch -b

刪除分支:git branch -d

刪除遠端分支:git push origin --delete

檢視當前分支的基本狀態:git status (如:分支名,)

新增某個檔案:git add

新增所有改動檔案:git add --all

提交改動並且注釋: git commit -m "注釋說明"

修改提交(沒有push之前):git commit -amend

推送到本地分支對應的遠端分支:git push

本地分支推送到遠端master分支中:git push origin master

遠端獲取,但不會merge:git fetch

遠端獲取,且merge:git pull

pull = fetch + merge

將branchname合併到當前分支:git merge

1.檢查分支:git status

2.新增:git add

3.提交:git commit -m "加本次提交的說明"

4.推到遠端對應分支:git push

5.git pull:拉取最新**

多人並行開發:

基本步驟同上

但是容易起衝突,需要解決衝突之後才能正確提交

可檢視log,或者使用視覺化工具.如:smartgit

git 基本命令

man git man git commit man git pull man git merge git config global user.name yourname git config global user.email yourname example.com cd home git m...

Git 基本命令

git config global user.name xx git config global user.email x com 1.建立專案資料夾 mkdir myproject 2.進入專案資料夾 cd myproject 3.初始化專案 git init 4.建立 readme.md tou...

Git 基本命令

說明 以下所有操作命令 均在 git bash 下執行,即命令為linux風格 檔案 以 txt 為例 其中,建立某乙個倉庫,在某一具體路徑下 執行 git init即可 幫助命令 git help 建立 respository git init 刪除 respository rm rf git 建...