Can't pull from git anymore

Discussions related to the firmware code development
ok1pt
Posts: 167
Joined: Mon Jul 20, 2020 3:38 am

Can't pull from git anymore

Post by ok1pt » Mon Sep 28, 2020 10:24 am

Hi!
I can't pull the changes into my local repo because of this error:
Fatal: Counldn't find remote ref refs/heads/split_dmr_filters.
I tried to find a solution, especially this looks very similar to my problem:
https://stackoverflow.com/questions/216 ... te-ref-xxx
There is a relatively comprehensive explanation, but their solution doesn't work for me.
(I extrapolated from their example to my paths):
patrol@deb:~/git/OpenGD77$ git branch -a
bugfix-chanmode-switch
* development
master
remotes/origin/development
remotes/origin/master
remotes/origin/split_dmr_filters
patrol@deb:~/git/OpenGD77$ git remote update --prune origin
Fetching origin
fatal: Couldn't find remote ref refs/heads/split_dmr_filters
error: Could not fetch origin
So, I'm still doing something wrong, because I'm getting recursively the same error when trying to fix it :-).
Please give a helping hand :-)...
WIth regards,
Pavel

User avatar
F1RMB
Posts: 2518
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: Can't pull from git anymore

Post by F1RMB » Mon Sep 28, 2020 10:35 am

Hi,

Can you give the "git remote -v" output ?


Cheers.
---
Daniel

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Can't pull from git anymore

Post by VK3KYY » Mon Sep 28, 2020 10:48 am

I deleted the old stale branches a few days ago,

e.g. split_dmr_filters that branch was merged into development a few months ago

ok1pt
Posts: 167
Joined: Mon Jul 20, 2020 3:38 am

Re: Can't pull from git anymore

Post by ok1pt » Mon Sep 28, 2020 11:01 am

F1RMB wrote:
Mon Sep 28, 2020 10:35 am
Hi,

Can you give the "git remote -v" output ?


Cheers.
---
Daniel
patrol@deb:~/git/OpenGD77$ git remote -v
origin https://github.com/rogerclarkmelbourne/OpenGD77 (fetch)
origin https://github.com/rogerclarkmelbourne/OpenGD77 (push)

User avatar
F1RMB
Posts: 2518
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: Can't pull from git anymore

Post by F1RMB » Mon Sep 28, 2020 11:17 am

Hi,

just reset you local copy (as you are on the development branch):

Code: Select all

git reset --hard origin/development
Take care, you will loose any change you made in the branch.


Cheers.
---
Daniel

VK3KYY
Posts: 7478
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Can't pull from git anymore

Post by VK3KYY » Mon Sep 28, 2020 11:38 am

If you didn't make many changes, just rename the folder and then clone again from github

You can then manually copy you files across.

But if you were using the split_dmr_filters branch as your base, its likely that things would have changed significantly and you will need to manually merge in whatever changes you made

ok1pt
Posts: 167
Joined: Mon Jul 20, 2020 3:38 am

Re: Can't pull from git anymore

Post by ok1pt » Mon Sep 28, 2020 12:51 pm

F1RMB wrote:
Mon Sep 28, 2020 11:17 am
Hi,

just reset you local copy (as you are on the development branch):

Code: Select all

git reset --hard origin/development
Take care, you will loose any change you made in the branch.


Cheers.
---
Daniel
Unfortunately, doesn't work :-(.

Code: Select all

patrol@deb:~/git/OpenGD77$ git reset --hard origin/development
HEAD is now at 803a7dcd Merge branch 'f1rmb-cleanup_getnextcontact' into development
patrol@deb:~/git/OpenGD77$ git pull
fatal: Couldn't find remote ref refs/heads/split_dmr_filters
In principle, I can rm my local repo and clone a new one, I made diff of all my local patches so I can reenter them, but it's interesting for me, I would like to learn git more deeply and it seems to be a good school here :-).

Regards, Pavel

User avatar
F1RMB
Posts: 2518
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: Can't pull from git anymore

Post by F1RMB » Mon Sep 28, 2020 3:24 pm

Did you tried to delete the branch

git branch -d split_dmr_filters

and/or delete all local branches that has ben removed from the remote

git remote prune origin --dry-run


Cheers.
---
Daniel

ok1pt
Posts: 167
Joined: Mon Jul 20, 2020 3:38 am

Re: Can't pull from git anymore

Post by ok1pt » Mon Sep 28, 2020 6:26 pm

F1RMB wrote:
Mon Sep 28, 2020 3:24 pm
Did you tried to delete the branch

git branch -d split_dmr_filters
Yes I did. One of my first intuitive tries. Doesn't work, tells that the branch cannot be found (it's not visible in git branch, git branch -a is neccessary and it's written i violet - I don't know what this color means.

and/or delete all local branches that has ben removed from the remote

git remote prune origin --dry-run
No, I didn't, so I did it now. It looked very promising, but...

Code: Select all

patrol@deb:~/git/OpenGD77$ git remote prune origin --dry-run
Pruning origin
URL: https://github.com/rogerclarkmelbourne/OpenGD77
 * [would prune] origin/split_dmr_filters
patrol@deb:~/git/OpenGD77$ git remote prune origin
Pruning origin
URL: https://github.com/rogerclarkmelbourne/OpenGD77
 * [pruned] origin/split_dmr_filters
patrol@deb:~/git/OpenGD77$ git pull
fatal: Couldn't find remote ref refs/heads/split_dmr_filters
It seems cursed :-)...

WIth regards / 73, Pavel

User avatar
F1RMB
Posts: 2518
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: Can't pull from git anymore

Post by F1RMB » Mon Sep 28, 2020 6:49 pm

Anything special in the .git/config (in the OpenGD77 tree) ?

Post Reply