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


轉載整理:

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

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

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

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

最近有同事在使用git bash 時輸錯密碼,后面git命令操作時一直報錯,報錯消息如下:

 

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

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

 

 

處理方法是:

1、在控制面板里找到憑據管理器:

 

2、選中Windows憑據:

 

 

3、點擊編輯,輸入所用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

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM