Home > Back-end >  Couldn't save backup of <filename> : git commit error during merge
Couldn't save backup of <filename> : git commit error during merge

Time:10-03

I am trying to merge branch p-jira-fix changes into branch p-main changes. Branch p-jira-fix has renamed one file from UserBase to EntityBase and somehow when I am running the git commit command, I am facing the following error regarding that file :

Merge command I started with :

git checkout p-main
git pull origin p-jira-fix
cp: app/yyy/src/main/java/com/xxx/ces/domain/UserBase.java: No such file or directory
Couldn't save backup of app/yyy/src/main/java/com/xxx/ces/domain/UserBase.java

I could not find this exact error on sof or git related posts. Has anyone faced this OR resolved it?

CodePudding user response:

This error message isn't a standard git error message (git wouldn't call the cp utility to copy files), it probably comes from an external script.

One standard feature which makes git execute external scripts are hooks. Check if you have any hook activated on your local repository :
run ls .git/hooks, and check for files not ending with .sample.

  • Related