I am trying to automate deployment of my project using Github Actions. The workflow is something like this:
git stash
git stash drop
git pull
# install dependencies and ...
When first two lines are executed, git cannot find any local change:
out: No local changes to save
err: No stash entries found.
But then after git pull runs, this happens:
err: From https://github.com/*****/*****
err: * branch main -> FETCH_HEAD
err: ****..**** main -> origin/main
err: error: The following untracked working tree files would be overwritten by merge:
err: thefile
err: Please move or remove them before you merge.
err: Aborting
Why is it happening?
>Solution :
Your changes are untracked. By default, git stash includes only tracked files.
If you want the changes to be stashed, you need either of the following:
- modify command to include untracked files:
git stash --include-untracked - make files tracked using git-add, e.g. to track all files:
git add *