git常見使用問題總結

2021-10-08 16:52:04 字數 992 閱讀 6969

1、git 如何將本地分支和遠端不同名分支關聯起來

未關聯前報錯:

error:src refspec release/clear_log dose not match any

error:failed to push some refs to 遠端git位址

解決git push origin a:b //將本地分支a與遠端分支b關聯

2、拉**:

git branch 分支名  /

/新建分支

git branch -a /

/檢視所有分支

git checkout 分支名 /

/切換分支

git status /

/檢視當前**狀態

git pull origin 遠端分支名 /

/拉取遠端**

3、推**:

git add 改動的檔案 或者 git add . 或者 git add -a

git commit 或者 git commit -m '操作內容'

git push origin 遠端分支名

4、git拉取遠端**並且不覆蓋本地修改的**

git stash     /

/暫存本地改動

git pull 遠端分支

git stash pop /

/將暫存內容還原

暫存**時,出現以下錯誤時:

致命錯誤:get-

write

-tree:錯誤構建樹,無法儲存當前索引狀態

可使用git reset --mixed命令後再使用git stash暫存

git 使用常見問題

git config global core.editor vim git config global diff.tool vimdiff git config global merge.tool vimdiffgit config global pull.rebase true git confi...

git使用常見問題?

1.今天從碼雲上clone乙個專案,等待一會後,一直提示rpc failed http 504 curl 22 the requested url returned error 504 gateway time out the remote end hung up unexpectedly 查了好久...

git使用常見問題

1.在團隊使用git的時候,尤其是多人合作的專案,經常會出現乙個問題,就是由於同乙個檔名大小寫不一致導致無法合併的問題。那我們應該怎麼來解決呢?可以使用git rm cached將衝突的檔案從git倉庫的快取中刪除,然後改名後再加入到git中 git rm cached mv git add git...