国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【git報錯】The current branch dev has no upstream branch. To push the current branch and set the remote

這篇具有很好參考價值的文章主要介紹了【git報錯】The current branch dev has no upstream branch. To push the current branch and set the remote。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

發(fā)現(xiàn)問題

本地新建了一個dev分支,然后把dev分支下的代碼push到遠程倉庫中,使用git push,但是報錯了,如下:
【git報錯】The current branch dev has no upstream branch. To push the current branch and set the remote
fatal: The current branch dev has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin dev

翻譯
錯誤:當前分支:dev沒有遠程對應的dev分支。
要推動當前分支并將遠程設置為上游,請使用。。。

原因

首先git push命令,是默認將當前分支Push到遠程的對應的分支,如果遠程不存在對應分支,則會報錯。比如這里,本地是dev分支,遠程沒有dev分支,使用這條命令默認就是對應遠程dev分支,所以就會報錯。

解決方法

方法1

根據(jù)提示的命令git push --set-upstream origin dev,這條命令是將遠程也重新創(chuàng)建一個分支dev,這樣就匹配了,然后再push

執(zhí)行完畢后,遠程就會多出一個dev分支,并且我的代碼也更新在了上面

方法2

指定分支push文章來源地址http://www.zghlxwxcb.cn/news/detail-506301.html

到了這里,關于【git報錯】The current branch dev has no upstream branch. To push the current branch and set the remote的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • fatal: The current branch master has no upstream branch之解決方法

    fatal: The current branch master has no upstream branch之解決方法

    ????????本地通過Git下載代碼后進行了修改,在推送至遠程倉庫時缺少目標倉庫地址 3.1 本地客戶端遠程連接目標倉庫 ?git remote add origin https://github.com/**/*.git【自己的SSH】 3.2 推送本地代碼至遠程倉庫分支 git push -u origin master ????????以上操作是在本地已經(jīng)執(zhí)行 add 及

    2024年02月15日
    瀏覽(16)
  • git 新建分支 推送到遠程 首次pull代碼報錯 git branch --set-upstream-to=origin/<branch>

    git 新建分支 推送到遠程 首次pull代碼報錯 git branch --set-upstream-to=origin/<branch>

    在本地創(chuàng)建新分支后,上傳到遠程倉庫,首次pull 的時候,會提示: 當前分支與遠程分支并未建立聯(lián)系,需要執(zhí)行一下 git branch --set-upstream-to=origin/ 操作 解決辦法: git branch --set-upstream-to=origin/遠程分支名 建立完聯(lián)系之后,就可以進行 git pull、git push 等操作啦~

    2024年02月16日
    瀏覽(23)
  • Git 分支跟蹤There is no tracking information for the current branch.

    當你執(zhí)行在develop分支上 git pull 返回提示: 解決辦法,即按照提示: 查看本地分支的遠端跟蹤分支 要查看本地分支跟蹤的遠端分支,可以使用 git branch 命令搭配不同的選項。以下是一些常用的命令及其說明: 查看所有本地分支及對應的遠端跟蹤分支: 使用 -vv 選項可以顯示

    2024年02月21日
    瀏覽(22)
  • Git出現(xiàn)There is no tracking information for the current branch提示的解決辦法

    Git出現(xiàn)There is no tracking information for the current branch提示的解決辦法 使用命令新建分支并切換到該分支 從遠程獲取代碼 報錯 There is no tracking information for the current branch. Please specify which branch you want to merge with. 意思是沒有當前分支的追蹤信息 解決: 以上兩行命令可簡寫為 即將本

    2024年02月12日
    瀏覽(22)
  • git 出現(xiàn) There is no tracking information for the current branch. Please specify which branch you want

    git 出現(xiàn) There is no tracking information for the current branch. Please specify which branch you want

    問題分析:當前pull對象沒有遠程分支的跟蹤信息,簡單地來說就是你創(chuàng)建的這個分支沒有和遠程倉庫中的其他分支或者master建立聯(lián)系,所以導致當前分支無法進行pull操作; 解決方案: git branch --set-upstream-to=origin/remote_name local_name 注解: remote_name : 遠程分支名 // 這里是你創(chuàng)

    2024年02月05日
    瀏覽(33)
  • git報錯:Updates were rejected because the tip of your current branch is behind

    多人協(xié)作項目,其他成員提交之后,你這邊沒有拉取最近代碼就要進行推送,遠程倉庫和本地倉庫不同步。 一般遠程倉庫和本地倉庫是同步的,當有另一個人克隆遠程倉庫并修改推送代碼后,你這邊的本地倉庫再進行推送會提示這個錯誤?!案卤痪芙^,因為您當前分支的提

    2024年02月15日
    瀏覽(33)
  • Can‘t update dev_zgd has no tracked branch

    Can‘t update dev_zgd has no tracked branch

    今天使用 Pycharm 時,本地在 dev 分支上,點擊 VCS 更新按鈕出現(xiàn)如下錯誤: 怎么解決呢? 輸入以下命令: 來設置分支主機以跟蹤遠程分支主機 試著更新一下,結果如下: Git更新,出現(xiàn)Can’t update: no tracked branch錯誤

    2024年02月13日
    瀏覽(21)
  • Git問題:出現(xiàn)報錯-You are not allowed to push code to protected branches on this project

    Git問題:出現(xiàn)報錯-You are not allowed to push code to protected branches on this project

    Git問題:出現(xiàn)報錯-You are not allowed to push code to protected branches on this project 最近不是在做數(shù)據(jù)安全分類分級的項目嗎,所以在公司的gitLab上新創(chuàng)建了一個 空白項目 ,但是在本地創(chuàng)建分支后提交到遠程時出來問題。 執(zhí)行提交 git push 的時候, 提示如下圖 然后跟隨提示執(zhí)行了下面

    2024年02月02日
    瀏覽(18)
  • git reset current branch to here

    git reset current branch to here

    reset current branch to here是git命令中的一種回滾操作。 其使用場景如下, 1)提交了多次錯誤的提交,想回滾到之前的某次提交。 2)合并了錯誤的分支,想回滾到合并之前。 該操作回滾到某次commit提交后,該commit提交之后提交的代碼都可以再次修改重新提交。 另外,還有一種

    2024年01月19日
    瀏覽(25)
  • 多種方法解決There is no tracking information for the current branch的錯誤

    多種方法解決There is no tracking information for the current branch的錯誤

    今天發(fā)布某版本的項目,準備創(chuàng)建個 v0point1 分支,后期如果修改該版本,直接在該分支上修改即可。 首先,使用 git branch v0point1 命令,創(chuàng)建本地分支 v0point1 ,如下圖所示: 其次,使用 git checkout v0point1 命令,切換到 v0point1 分支,如下圖所示: 當然,我們也可以使用 git ch

    2024年02月09日
    瀏覽(35)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包