Wednesday, July 6, 2016

Change file permissions on git

If you push an executable file to git, its likely you wont have the right permissions.

D:\git\app>git ls-tree HEAD
100644 blob 390ce9106bc0e91a631cf345621b35b96bf74d20

As you can see its 644 (Ignore the 100)

Change it to 755:

D:\git\app>git update-index --chmod=+x
D:\git\app>git status
On branch feature/app_move
Your branch is up-to-date with 'origin/feature/app_move'.

Changes to be committed:
  (use "git reset HEAD ..." to unstage)


D:\git\app>git commit -m "SLUG-11698 : Changing file perms"
D:\git\app>git push
D:\git\app>git ls-tree HEAD
100755 blob 390ce9106bc0e91a631cf345621b35b96bf74d20 is now executable :)

No comments:

Post a Comment