Coding配合git使用時遇到的問題

轉載整理:html

https://www.jianshu.com/p/b23cd00cffa6git

https://www.cnblogs.com/yidoucai/p/5228763.html github

 https://blog.csdn.net/sinat_36184075/article/details/80115000bash

關於git輸錯用戶名和密碼報錯相關問題的說明

最近有同事在使用git bash 時輸錯密碼,後面git命令操做時一直報錯,報錯消息以下:post

 

remote: Coding 提示: Authentication failed! 認證失敗,請確認您輸入了正確的帳號密碼fetch

fatal: Authentication failed for 'https://git.coding.net/......this

 

 

處理方法是:spa

一、在控制面板裏找到憑據管理器:.net

 

二、選中Windows憑據:orm

 

 

三、點擊編輯,輸入所用github的正確用戶名和密碼:

 

 

再去輸入git命令就ok了。

 

#git push origin master出錯:error: failed to push some refs to

 

1.輸入git push origin master

出錯:error: failed to push some refs to

那是由於本地沒有update到最新版本的項目(git上有README.md文件沒下載下來)

本地直接push因此會出錯。

2.因此本地要輸入git pull

而後出現的英語提示'git pull <repository> <refspec>'顯示要選擇遠程分支

2.就試試指定目標到遠程分支

輸入git pull origin

出現提示

but did not specify
a branch. Because this is not the default configured remote
for your current branch

3.,重置pull origin!

輸入git pull --rebase origin master

成功update到最新文件

4.輸入git push origin master

整個項目就上傳到coding雲了

5.仍是得多學英語才能再stackoverflow混

參考資料

git error: failed to push some refs to

 

See git-pull(1) for details

 

    git pull <remote> <branch>

好比git pull origin master

從遠端origin拉取master分支的內容而後合併到當前所處的本地分支。直接git pull的話默認遠程庫是orgin,默認遠程庫的分支是master。 

If you wish to set tracking information for this branch you can do so with:

 指定遠程分支

    git branch --set-upstream-to=origin/<branch> master

好比咱們設置遠程庫origin的master分支

git branch --set-upstream-to=origin/master

 

#【git】強制覆蓋本地代碼(與git遠程倉庫保持一致)

git強制覆蓋:
    git fetch --all
    git reset --hard origin/master
    git pull

 

git強制覆蓋本地命令(單條執行):
    git fetch --all && git reset --hard origin/master && git pull
相關文章
相關標籤/搜索