git中出現”the requested upstream branch ‘origin/master‘ does not exist“問題的解決
在使用git上傳專案到遠端倉庫時發現的一個問題,在網上搜尋到解決辦法後覺得這個問題比較典型,所以寫個部落格記錄下來。
問題產生
在本地有一個git專案,已經提交到本地倉庫,現在想把這個專案上傳到遠端倉庫,於是在github上建立遠端倉庫,然後使用git branch
進行關聯,結果報錯。
解決辦法
輸入命令
git pull origin master --allow-unrelated-histories
這裡會要求你輸入使用者名稱密碼,然後確認提交資訊
再輸入命令
git branch --set-upstream-to=origin/master master
就可將本地倉庫與遠端倉庫相關聯。接下來就可以繼續使用git fetch
,git push
等命令進行操作了。
相關文章
- our branch is based on ‘origin/lhl‘, but the upstream is gone.Go
- git merge origin master git merge origin/master區別GitAST
- homebrew安裝問題(Failed during: git fetch origin master:refs/remotes/origin/master --tags --force)AIGitASTREM
- Cocoapods fatal: Remote branch #{s.version} not found in upstream originREM
- git push --set-upstream originGit
- git push origin master 時出現報錯 error: src refspec master does not match any error: failed to push someGitASTErrorAI
- (轉載)git pull origin master與git pull --rebase origin master的區別GitAST
- Android Studio Git No tracked branch configured for branch branch_name or the branch doesn't existAndroidGit
- Laravel Class env does not exist 問題排查Laravel
- 解決 Jenkins 上 git 出現的 “ERROR: Error fetching remote repo 'origin'” 問題JenkinsGitErrorREM
- git - git push origin master 報錯GitAST
- git關於origin和masterGitAST
- 解決git 不同branch 下node_moudes不同步的問題Git
- Hadoop的mapreduce出現問題,報錯The auxService:mapreduce_shuffle does not existHadoopUX
- Spark SQL中出現 CROSS JOIN 問題解決SparkSQLROS
- 在Git中,origin / master與origin master之間有什麼區別?GitAST
- 解決 nginx 反向代理時的 upstream timeout 問題Nginx
- Spring中出現:No bean named 'XXX' available問題解決SpringBeanAI
- git學習:關於origin和masterGitAST
- The operation, ‘DecodeJpeg/contents‘, does not exist in the graph.錯誤解決方法
- git branch不顯示本地分支的問題(二)Git
- 高版本mysql訪問出現Client does not support authentication protocol requested by server;MySqlclientProtocolServer
- Android解決The APK file app-debug.apk does not exist on disk.AndroidAPKAPP
- navicat本地連線mysql出現1251--Client does not support authentication protocol requested by server的解決方法MySqlclientProtocolServer
- axios跨域問題 No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.iOS跨域Header
- brew 報錯 error: Not a valid ref: refs/remotes/origin/master 的解決方法ErrorREMAST
- Error: The directory named as part of the path ./log/supervisord.log does not exist解決方案Error
- 初次git提交程式碼報錯:Push to origin/master was rejectedGitAST
- git rebase後出現(master|REBASE 1/10)的解決辦法GitAST
- git常見問題解決Git
- Waring: /dev/centos/swap does not existdevCentOS
- Property [title] does not exist on this collection instance
- PSQLexception: ERROR : type "signed" does not existSQLExceptionError
- ValueError: Length of values (141) does not match length of index (4278)問題的解決ErrorIndex
- 如何解決精益生產專案中出現的問題?
- git show-branch命令詳解Git
- git 解決版本衝突問題Git
- Git常見問題及解決Git