Git報(bào)錯error:pathspec‘XXX‘did not match any file(s) known to git問題及解決過程
問題復(fù)現(xiàn)
① 在本地分支切換到同事新創(chuàng)建的分支:
git checkout xxx
② 報(bào)錯:
error: pathspec 'XXX' did not match any file(s) known to git
解決方法
① 查看本地的所有的分支中是否有同事新創(chuàng)建的分支:
git branch -a
② 如果沒看到,那么執(zhí)行以下操作,這步是獲取所有分支:
git fetch
③ 執(zhí)行完會看到這樣提示:
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
Unpacking objects: 100% (4/4), 1.06 KiB | 90.00 KiB/s, done.
From codeup.aliyun.com:5eeb0689892c58bb7c394ab5/pxb/pxb-fronted
* [new branch] XXX -> origin/XXX
④ 切換到遠(yuǎn)程同事分支:
git checkout origin/XXX
提示:
Note: switching to 'origin/XXX'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at dc877cd XXX
⑤ 現(xiàn)在可以看到自己的分支是一串?dāng)?shù)字字母,這時新建并切換到同事的分支:
git checkout -b XXX
⑥ 現(xiàn)在需要跟遠(yuǎn)程的同事分支進(jìn)行關(guān)聯(lián):
git branch -u origin/XXX XXX
⑦ 這時我們執(zhí)行g(shù)it pull來看看什么反饋:
git pull
Already up-to-date.
⑧ 此時,可以如果修改了代碼后,需要進(jìn)行的操作就是:
查看修改狀態(tài):git status -s 添加到本地暫存區(qū):git add ./ 添加到本地倉庫:git commit -m "[ADD]新增了某功能" 添加到遠(yuǎn)程倉庫,遠(yuǎn)程倉庫中會多一個分支xxx:git push origin xxx
總結(jié)
以上為個人經(jīng)驗(yàn),希望能給大家一個參考,也希望大家多多支持腳本之家。
- npm run serve運(yùn)行vue項(xiàng)目時報(bào)錯:Error: error:0308010C:digital envelope routines::unsupported的解決方法
- git?clone報(bào)錯SSL?connect?error解決
- python解決報(bào)錯ImportError: Bad git executable.問題
- vue-cli-service serve報(bào)錯error:0308010C:digital envelope routines::unsupported
- Vue報(bào)錯error:0308010C:digital?envelope?routines::unsupported的解決方法
相關(guān)文章
使用noopener和noreferrer讓HTML中的外部鏈接更安全
在跳轉(zhuǎn)時,不再把“從哪個頁面來的”這個信息,?通過?HTTP?Referer?頭部傳給目標(biāo)站點(diǎn),你以為你只是好心把外鏈丟到新標(biāo)簽頁,?結(jié)果人家順著這條“繩子”,直接把你的原頁面拖走了,使用noopener和noreferrer可以讓HTML中的外部鏈接更安全2025-12-12
git提交驗(yàn)證規(guī)范并自動生成日志文件的方法
這篇文章主要介紹了git提交驗(yàn)證規(guī)范并自動生成日志文件的相關(guān)知識,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-11-11
windows開發(fā)記事本程序紀(jì)實(shí)(一)界面篇
這將是一個系列博文,后面會繼續(xù)補(bǔ)充邏輯功能的開發(fā)的步驟。本節(jié)主要實(shí)現(xiàn)記事本的主界面設(shè)計(jì),包括主界面窗口的構(gòu)建、菜單的加入。雖然都是一些基本的操作,但是還是想將這些基本步驟完整地記錄下來,以便后續(xù)驗(yàn)證。2014-08-08
關(guān)于Unity動畫狀態(tài)機(jī)Animator使用教程
這篇文章主要介紹了關(guān)于Unity動畫狀態(tài)機(jī)Animator的使用教程,有需要的朋友可以借鑒參考下,希望可以對廣大讀者朋友能夠有所幫助2021-09-09
五步完成unity與微信(游戲)小程序交互創(chuàng)建視頻
這篇文章主要介紹了unity與微信(游戲)小程序交互創(chuàng)建視頻的步驟,非常簡單,只需要五步就可完成,有需要的朋友可以借鑒參考下,希望可以有所幫助2021-09-09
Postman設(shè)置環(huán)境變量的實(shí)現(xiàn)示例
本文主要介紹了Postman設(shè)置環(huán)境變量的實(shí)現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-02-02

