第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

為什么我總是要做‘-設(shè)置-向上’?

為什么我總是要做‘-設(shè)置-向上’?

Git
素胚勾勒不出你 2019-07-08 14:47:49
為什么我總是要做‘-設(shè)置-向上’?我在Git創(chuàng)建了一個(gè)新的分支機(jī)構(gòu):git branch my_branch推它:git push origin my_branch現(xiàn)在假設(shè)有人在服務(wù)器上做了一些更改,我想從origin/my_branch..我知道:git pull但我明白:You asked me to pull without telling me which branch you want to merge with, and 'branch.my_branch.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details. If you often merge with the same branch, you may want to use something like the following in your configuration file:     [branch "my_branch"]     remote = <nickname>     merge = <remote-ref>     [remote "<nickname>"]     url = <url>     fetch = <refspec> See git-config(1) for details.我學(xué)到了我可以讓它發(fā)揮作用:git branch --set-upstream my_branch origin/my_branch但是為什么我要為我創(chuàng)建的每一個(gè)分支都這樣做呢?很明顯如果我推my_branch進(jìn)origin/my_branch,那我就想拉origin/my_branch進(jìn)my_branch?如何使這成為默認(rèn)行為?
查看完整描述

3 回答

?
ITMISS

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超8個(gè)贊

快捷方式,它不依賴于記住git branch --set-upstream 1是要做:

git push -u origin my_branch

..你第一次推那根樹枝。或者,將當(dāng)前分支推送到同名的分支(別名方便):

git push -u origin HEAD

你只需要用-u一次,這就建立了你的分支和origin以同樣的方式git branch --set-upstream的確如此。

就我個(gè)人而言,我認(rèn)為必須明確地在您的分支和遠(yuǎn)程上的分支之間建立關(guān)聯(lián)是一件好事。令人遺憾的是這些規(guī)則不同的git pushgit pull.


1這聽起來可能很愚蠢,但我經(jīng)常忘記指定當(dāng)前的分支,假設(shè)這是默認(rèn)的-它不是,結(jié)果是最令人困惑的:)

更新2012-10-11顯然,我并不是唯一一個(gè)發(fā)現(xiàn)容易出錯(cuò)的人!感謝馮克指出git 1.8.0引入了更明顯的git branch --set-upstream-to,可以如下所示,如果您在分支上my_branch:

git branch --set-upstream-to origin/my_branch

..或者是短期選擇:

git branch -u origin/my_branch

這一變化及其原因?qū)⒃?/trans>Git 1.8.0的發(fā)行說明,第1版:

我很想說git branch --set-upstream origin/master,但這告訴吉特要安排當(dāng)?shù)氐姆种C(jī)構(gòu)。origin/master與當(dāng)前簽出的分支集成,這不太可能是用戶的意思。不建議使用該選項(xiàng);請(qǐng)使用新的--set-upstream-to(短而甜)-u)選項(xiàng)。


查看完整回答
反對(duì) 回復(fù) 2019-07-08
  • 3 回答
  • 0 關(guān)注
  • 456 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)