PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 14, 2022

[FIXED] How do I remove the .exec extension git applies to files?

 September 14, 2022     bitbucket, exec, git, ios, pull-request     No comments   

Issue

I messed up so I downloaded an old commit and tried to build from some old code that functioned as intended. I see the files (Podfile, License Gemfile etc) now have a .exec extension and when I push to bitBucket they have a "+x" annotation. When you hover over it says this file is now executable.

Everything still happens to build and run successfully but why does git add this extension to my files without my say so? This issue is causing some concern on my pull request. How do I return my files to being just plainText or whatever they were originally?

I've tried to run chmod -x $(find . -type exec) in the offending directory but this doesn't seem to work.

Anyone know how restore my file to their former purity???


Solution

You could:

  • rename your files
  • add them again, explicitely removing the 'x' executable bit with git add --chmod=-x aFile

Then you can commit and push again.


But make sure to use Git 2.31 (Q1 2021), because of various fixes on "git add --chmod"(man)".

See commit 9ebd7fe, commit 4896089, commit c937d70 (22 Feb 2021) by Matheus Tavares (matheustavares).
(Merged by Junio C Hamano -- gitster -- in commit f277234, 25 Feb 2021)

add: propagate --chmod errors to exit status

Signed-off-by: Matheus Tavares
Reviewed-by: Taylor Blau

If add encounters an error while applying the --chmod changes, it prints a message to stderr, but exits with a success code.
This might have been an oversight, as the command does exit with a non-zero code in other situations where it cannot (or refuses to) update all of the requested paths (e.g. when some of the given paths are ignored).
So make the exit behavior more consistent by also propagating --chmod errors to the exit status.

And:

add --chmod: don't update index when --dry-run is used

Helped-by: Junio C Hamano
Signed-off-by: Matheus Tavares
Reviewed-by: Taylor Blau

git add --chmod(man) applies the mode changes even when --dry-run is used.
Fix that and add some tests for this option combination.



Answered By - VonC
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing