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

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

如何使git始終從特定分支中提???

如何使git始終從特定分支中提取?

Git
一只斗牛犬 2019-11-21 10:32:47
我不是git master,但是我已經(jīng)和它一起工作了一段時(shí)間了,并且有幾個(gè)不同的項(xiàng)目。當(dāng)然,在每個(gè)項(xiàng)目中,從那時(shí)git clone [repository]起,我始終可以git pull,并且只要沒有特別的變化,我就可以始終如此。最近,我不得不還原到上一個(gè)分支,并使用進(jìn)行了此操作git checkout 4f82a29。當(dāng)我再次準(zhǔn)備拉動(dòng)時(shí),我發(fā)現(xiàn)必須將分支設(shè)置回master?,F(xiàn)在,我不能使用直線git pull,而是必須指定git pull origin master,這很煩人,并向我表明我不完全了解發(fā)生了什么。發(fā)生了什么變化,哪些使我無法在git pull不指定原點(diǎn)大師的情況下進(jìn)行平直比賽?如何更改它?更新:-bash-3.1$ cat config[core]    repositoryformatversion = 0    filemode = true    bare = false    logallrefupdates = true[branch "master"][remote "origin"]    url = git@github.com:user/project.git    fetch = refs/heads/*:refs/remotes/origin/*更新2:明確地說,我知道我的原始方法可能不正確,但是我需要修復(fù)此存儲(chǔ)庫,以便可以git pull再次使用。目前,git pull導(dǎo)致:-bash-3.1$ git pullYou asked me to pull without telling me which branch youwant to merge with, and 'branch.master.merge' inyour configuration file does not tell me either.  Pleasename which branch you want to merge on the command line andtry again (e.g. 'git pull  ').See git-pull(1) for details on the refspec.If you often merge with the same branch, you may want toconfigure the following variables in your configurationfile:    branch.master.remote =     branch.master.merge =     remote..url =     remote..fetch = See git-config(1) for details.我可以說出git pull要合并的分支,它可以正常工作,但git pull不能像原來的分支那樣工作git checkout。
查看完整描述

3 回答

?
慕哥6287543

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

在下[branch "master"],嘗試將以下內(nèi)容添加到倉庫的Git配置文件(.git/config):


[branch "master"]

    remote = origin

    merge = refs/heads/master

這告訴Git 2件事:


當(dāng)您在master分支上時(shí),默認(rèn)的遙控器是origin。

在git pullmaster分支上使用(未指定任何遠(yuǎn)程和分支)時(shí),請使用默認(rèn)的remote(來源)并合并來自remote master分支的更改。

我不確定為什么會(huì)從您的配置中刪除此設(shè)置。您可能也必須遵循其他人發(fā)布的建議,但這可能有用(或至少有幫助)。


如果您不想手動(dòng)編輯配置文件,則可以使用命令行工具:


$ git config branch.master.remote origin

$ git config branch.master.merge refs/heads/master


查看完整回答
反對 回復(fù) 2019-11-21
  • 3 回答
  • 0 關(guān)注
  • 615 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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