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):

user.email=foo@foo.com
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
user.email=foo@foo.com
core.autocrlf=true
core.filemode=false

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
BPL
  • 9,632
  • 9
  • 59
  • 117
  • Current cygwin : `$ git --version` `git version 2.8.3 ` Are you sure to have a proper cygwin installation ? – matzeri Aug 04 '16 at 05:40
  • @matzeri I've upgraded the git package to match yours, `$ git --version git version 2.8.3` but the problem still [persists](http://screencast.com/t/7CV8WYLsUV). The project I'm using to figure out how to solve my issue is [this](https://github.com/enigmastudio/Enigma-Studio-4), 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 04 '16 at 10:49

1 Answers1

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
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 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 '18 at 21:38