Re: [Request] Git reset should be able to ignore file permissions
- From
John Keeping <john@keeping.me.uk>
- Date
- Jun 18, 2013, 14:01 UTC
- Message-ID
- <20130618140120.GD4676@serenity.lan>
- In-Reply-To
- <CACuz9s31OUWNxTqCmj7ukAo7=TpXK7zBv5kTFZ5obpXKOju9ng@mail.gmail.com>
On Tue, Jun 18, 2013 at 03:25:22PM +0200, Alexander Nestorov wrote:
Show 17 quoted lines
> 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.