-2

Is it possible to hide the date when a file was last modified? If not then maybe there's any way of changing the date so it would show a previous date than the actual one?

Using either the Web interface or windows' cmd

There's a need for some type of users to not be able to see this information. Also, there's a need for some old project to hide this information.

CodeMonkey
  • 97
  • 2

2 Answers2

2

No, you can't (without rewriting the history and force pushing to the GitHub repository which is a bad idea!). It somewhat defeats the purpose of a version control system which is to track when who changed what.

Sethos II
  • 507
  • 4
  • 7
  • 18
  • Ok so you say it IS possible. How? – CodeMonkey Mar 14 '17 at 07:28
  • Technically yes. The keyword is rebase. See for example this: https://blog.jacius.info/2008/06/22/git-tip-fix-a-mistake-in-a-previous-commit/ (at the Update 2008-09-06 part). Change your local time during the `git commit --amend`. Afterwards do a `git push -f`. But my adwise is still: DON'T. – Sethos II Mar 14 '17 at 08:01
  • Is there a way of doing it after a push was done so the commit date would be an earlier date? – CodeMonkey Mar 14 '17 at 08:31
  • Yes, this is what the `git push -f` is for. This will override the remote repository with your local one (with the changed commit timestamps). But this will break all other clones of your repository which is bad and the reason why it shouldn't be done. – Sethos II Mar 14 '17 at 08:41
0

you can change your local date before committing, but, as Sethos II said, it won't be advisable

egg
  • 31
  • 2