Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Last active April 14, 2021 06:45
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadLittleMods/f0b061e323166d66230c2f0c5fcd1e73 to your computer and use it in GitHub Desktop.
Save MadLittleMods/f0b061e323166d66230c2f0c5fcd1e73 to your computer and use it in GitHub Desktop.

Often when I try to merge a branch with Git on Windows, I get Permission denied errors. I am not sure what is the cause but cleaning up and trying to the merge again works.

Steps

> git merge develop
error: unable to create file public/less/bootstrap/dropdowns.less (Permission denied)

This will leave a bunch of files in your unstaged area 👎

Run the following Git commands to reset back before the merge to get rid of the files in the staging area

> git reset --hard origin/feature/something
> git clean -fd

Now the merge will work 😕

> git merge develop
@FabianoFaria
Copy link

I follow yours steps, it´s works, I just have to deal with the mess around the conflict with the files.

@stevenYouhana
Copy link

I found when I have Atom open, when I close it and try to merge it works. So it can be an issue relating to Atom editor

@tbntdima
Copy link

@stevenYouhana, the same, thanks for advice.

@pavelrevak
Copy link

same with sublimetext

@muhammed-ajmal
Copy link

I found when I have Atom open, when I close it and try to merge it works. So it can be an issue relating to Atom editor

Thank you ! @stevenYouhana

@jucemar-dimon
Copy link

It worked well, Thank you!

@ariel-frischer
Copy link

Same with Windows 10 + VSCode + Bash terminal, I want to end this forever, not go through this everytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment