Error during build update

Hi,

I compile my own build with dnsproxy and I had already updated it to 0.74.1 by myself, now this package is also up to date in master, so when I try to update my whole compilation with git pull and ./scripts/feeds update -a && ./scripts/feeds install -a, I got error , do you know how to resolve it?
thanks, even if I commit or stash nothing happens.

From https://git.openwrt.org/feed/packages
   2516d2b..99a4a0f  master     -> origin/master
Updating 2516d2b..99a4a0f
error: Your local changes to the following files would be overwritten by merge:
        net/dnsproxy/Makefile
Please commit your changes or stash them before you merge.
Aborting
failed.

You can try to do this if you want your commits preservered and use them again

git stash #will set commits aside
git pull
git stash pop  # will redo commits which were set aside

If not clean and rinse:

git reset --hard
git submodule sync --recursive
git submodule update --init --force --recursive
git clean -ffdx .    # note the dot . at the end of command
git submodule foreach --recursive git clean -ffdx
git pull
2 Likes

it will erase my last changes?
like dnsproxy update?

Yes it will.

If you want to preserve your commits then use the stash/pop

1 Like
james@Flint2/main$ git stash
No local changes to save
james@Flint2/main$ git pull
Already up to date.
james@Flint2/main$ git stash pop
No stash entries found. 

stash/pop will only work if you actually have added/committed the changes otherwise git does not know what you have changed

To see what you have changed:
git status

To add the changed files:
git add . # note the dot which means add all changes

1 Like

ok so for that error during update, I need to git reset --hard?

./scripts/feeds update -a && ./scripts/feeds install -a
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git' ...
Updating 2516d2b..99a4a0f
error: Your local changes to the following files would be overwritten by merge:
        net/dnsproxy/Makefile
Please commit your changes or stash them before you merge.
Aborting

See my previous answer how to add changes to your repo so that you can do stash / pop

1 Like

yes but this is the problem, the problem is related to dnsproxy.

so everything is clean around

git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

I tried that, everything is deleted....

Of course see my answer:

I tried but ;

james@Flint2/main$ git stash
No local changes to save
james@Flint2/main$ git pull
Already up to date.
james@Flint2/main$ git stash pop
No stash entries found. 

In your case git does not see anything changed.

Use git status to see what git sees as changed if there are changes outside git then you should add those changes to git first by adding the file/directory in the git tree first.
Usually git tracks everything inside the main git directory tree

That's not true. No need for that. The whole point of git stash is to 'save' uncommitted changes.

What is necessary, though, is running the git commands in the right directory. That might be feeds/packages/, off the top of my head.

3 Likes

Yeah that was not formulated very well, I meant git has to know the changes and it tracks only changes in the git tree, if you have changes outside the git tree you have to add/move it inside the git tree

2 Likes

Just checked: the path is indeed feeds/packages:


~/code/lede/24.10/feeds/packages$ git status
On branch openwrt-24.10
Your branch is up to date with 'origin/openwrt-24.10'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   net/curl/Makefile
1 Like

Like Borromini says you need to change working dir to that feed's root dir feeds/packages
Feed has its own git repo, which is separate of the main OpenWrt git.

cd feeds/packages
And then git stash etc.

1 Like

Thanks all of you.
@Borromini had the answer. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.