Page 1 of 2

Can't pull from git anymore

Posted: Mon Sep 28, 2020 10:24 am
by ok1pt
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 10:35 am
by F1RMB
Hi,

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


Cheers.
---
Daniel

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 10:48 am
by VK3KYY
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 11:01 am
by ok1pt
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)

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 11:17 am
by F1RMB
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 11:38 am
by VK3KYY
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 12:51 pm
by ok1pt
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 3:24 pm
by F1RMB
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 6:26 pm
by ok1pt
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

Re: Can't pull from git anymore

Posted: Mon Sep 28, 2020 6:49 pm
by F1RMB
Anything special in the .git/config (in the OpenGD77 tree) ?