3

When I try to clone projects using Cygwin's Git 2.7.0 I'm having some issues related to permissions. This is, every time I try running one of the cloned project's executables I'm getting the next error:

Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

If I instead use Cygwin's Git, the one included in Attlasian SourceTree, projects will be cloned "properly", and I won't be getting any issue. Below I list both Git's global configurations:

Cygwin's Git (2.7.0):

[email protected]
user.name=foo
alias.default=!git add -A && git commit -m 'default commit'
core.filemode=false
core.autocrlf=true

SourceTree's Git (Git version 1.9.5.msysgit.0):

user.name=foo
[email protected]
core.autocrlf=true
core.filemode=false

How can I configure Cygwin's Git (or other stuff) properly to avoid having such permissions issues?

2
  • Current cygwin : $ git --version git version 2.8.3 Are you sure to have a proper cygwin installation ?
    – matzeri
    Aug 4, 2016 at 5:40
  • @matzeri I've upgraded the git package to match yours, $ git --version git version 2.8.3 but the problem still persists. The project I'm using to figure out how to solve my issue is this, once you've cloned you'll find an executable inside binary\estudio4.exe . I've forgot to mention I'm using windows7 x64.
    – BPL
    Aug 4, 2016 at 10:49

1 Answer 1

2

That reminds me of Alexpux/MSYS2-packages issue 222:

On Linux if you want to execute a file it must have the correct permissions. By default a touched file will not have this, for security reasons.

However Windows has a wrong-headed take on this, in that a file created with New > Text Document automatically has execute permissions.

So what looks to have happened in this case is that whoever created the batch files did so in a MSYS2 environment, hence the correct lack of execute permissions.
What they did not do is chmod +x to correctly give these files execute permission, as would have been done if the files were created with Windows native tools.

So a simple chmod +x should be enough.

And then, with Git 2.9.1 or more:

git add --chmod=+x -- afile
1
  • 1
    I'm impressed, it's awesome to know someone still look very old unanswered questions like this one and providing good answers. Thanks!
    – BPL
    Jul 23, 2018 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.