Change in GIT log

Asked

Viewed 67 times

-1

I would like to change my GIT server log using a hook.

The situation is this, when someone gives a commit and the local machine is with the wrong date, in the log appears the time of the local machine. I would like a hook to change the date and time automatically synchronizing with the server where the repository is.

  • 5

    You already asked this question, dear http://answall.com/q/115000/41113. I had even done some research to answer you in the original. But I came to the conclusion that it was going to get complicated. My tip of what you can do is: have a clone of your repository on the server (since you can’t change the repository itself), and put a post-commit hook script that gives a cd to that clone on the server and change the commit time. Problem: You’ll be rebasing in the repository, and if you have multiple users of Repo (multiple clones), it will generate multiple conflicts when they were to update.

1 answer

-2


In my humble opinion, I wouldn’t mind that. Even so, I recommend you take a look at this Git date and time article.

Edit:

Apparently I wasn’t clear enough, having my answer negative. The link I recommended teaches how to use git commit --date and git commit -ammend --date which are the commands you will use in your hook.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.