Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [Request] Git reset should be able to ignore file permissions

From: John Keeping <hidden>
Date: 2016-06-15 22:57:48

On Tue, Jun 18, 2013 at 03:25:22PM +0200, Alexander Nestorov wrote:
Recently I had to write some automation scripts and I found
that git reset --hard actually restores each file's permissions.

That is causing both the created and the last-modified dates
of the file to get changed to the time of the git reset.

This behavior is easy to demonstrate:

echo "test" > myfile
chmod 777 myfile
git add myfile && git commit -m "Test" && git push
chmod 775 myfile
git reset --hard origin/master

After the git reset --hard command, the entire file was
checkout-ed. Instead, git should be able to check if the
content of the file changed and only if it did, check it out.
Does "git reset --keep" behave in the same way?  I would expect it to
leave permissions as they were.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help