ios - 如何删除 .exec 扩展名 git 适用于文件?
<p><p>我搞砸了,所以我下载了一个旧提交并尝试从一些按预期运行的旧代码构建。我看到文件(Podfile、License Gemfile 等)现在有一个 .exec 扩展名,当我推送到 bitBucket 时,它们有一个“+x”注释。当您将鼠标悬停在它上面时,表示该文件现在是可执行的。</p>
<p>一切仍然会成功构建和运行,但为什么 git 在我没有说的情况下将此扩展名添加到我的文件中?这个问题引起了我的 pull 请求的一些关注。如何将我的文件恢复为纯文本或原始文件?</p>
<p>我尝试在有问题的目录中运行 chmod -x $(find . -type exec) 但这似乎不起作用。</p>
<p>任何人都知道如何将我的文件恢复到以前的纯度???</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>你可以:</p>
<ul>
<li>重命名文件</li>
<li>再次添加它们,用 <a href="https://git-scm.com/docs/git-add#Documentation/git-add.txt---chmod-x" rel="noreferrer noopener nofollow"><code>git add --chmod=-x aFile</code></a> 明确删除“x”可执行位</li>
</ul>
<p>然后你可以再次提交并推送。</p>
<hr/>
<p>但请确保使用 Git 2.31(2021 年第一季度),因为对“<a href="https://github.com/git/git/blob/f277234860b2e5e142ab72d2c288f6fd94bd2219/Documentation/git-add.txt" rel="noreferrer noopener nofollow"><code>git add--chmod</code></a>”<sup>(<a href="https://git-scm.com/docs/git-add" rel="noreferrer noopener nofollow">man</a>)</sup>“进行了各种修复。</p>
<p>见 <a href="https://github.com/git/git/commit/9ebd7fe15869910c81c42290bd80296664597dec" rel="noreferrer noopener nofollow">commit 9ebd7fe</a> , <a href="https://github.com/git/git/commit/48960894f5a89639809bdad5618439ba59869522" rel="noreferrer noopener nofollow">commit 4896089</a> , <a href="https://github.com/git/git/commit/c937d70bfb7661d5122e08758ae0531073a719ed" rel="noreferrer noopener nofollow">commit c937d70</a> (2021 年 2 月 22 日)作者 <a href="https://github.com/matheustavares" rel="noreferrer noopener nofollow">Matheus Tavares (<code>matheustavares</code>)</a> .<br/>
<sup>(由 <a href="https://github.com/gitster" rel="noreferrer noopener nofollow">Junio C Hamano -- <code>gitster</code> --</a> 在 <a href="https://github.com/git/git/commit/f277234860b2e5e142ab72d2c288f6fd94bd2219" rel="noreferrer noopener nofollow">commit f277234</a> 中 merge ,2021 年 2 月 25 日)</sup></p>
<blockquote>
<h2><a href="https://github.com/git/git/commit/9ebd7fe15869910c81c42290bd80296664597dec" rel="noreferrer noopener nofollow"><code>add</code></a>: propagate <code>--chmod</code> errors to exit status</h2>
<p><sup>Signed-off-by: Matheus Tavares</sup><br/>
<sup>Reviewed-by: Taylor Blau</sup></p>
</blockquote>
<blockquote>
<p>If <code>add</code> encounters an error while applying the <code>--chmod</code> changes, it prints a message to stderr, but exits with a success code.<br/>
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).<br/>
So make the exit behavior more consistent by also propagating <code>--chmod</code> errors to the exit status.</p>
</blockquote>
<p>还有:</p>
<blockquote>
<h2><a href="https://github.com/git/git/commit/c937d70bfb7661d5122e08758ae0531073a719ed" rel="noreferrer noopener nofollow"><code>add --chmod</code></a>: don't update index when <code>--dry-run</code> is used</h2>
<p><sup>Helped-by: Junio C Hamano</sup><br/>
<sup>Signed-off-by: Matheus Tavares</sup><br/>
<sup>Reviewed-by: Taylor Blau</sup></p>
</blockquote>
<blockquote>
<p><a href="https://github.com/git/git/blob/c937d70bfb7661d5122e08758ae0531073a719ed/Documentation/git-add.txt#L186" rel="noreferrer noopener nofollow"><code>git add --chmod</code></a><sup>(<a href="https://git-scm.com/docs/git-add#Documentation/git-add.txt---chmod(+%7C-)x" rel="noreferrer noopener nofollow">man</a>)</sup> applies the mode changes even when <code>--dry-run</code> is used.<br/>
Fix that and add some tests for this option combination.</p>
</blockquote></p>
<p style="font-size: 20px;">关于ios - 如何删除 .exec 扩展名 git 适用于文件?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/55251763/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/55251763/
</a>
</p>
页:
[1]