Преглед изворни кода

doc/dev/contrib/tor.md: commit timestamps timezones remedy added

skoupidi пре 1 година
родитељ
комит
0d82ccef43
1 измењених фајлова са 20 додато и 0 уклоњено
  1. 20 0
      doc/src/dev/contrib/tor.md

+ 20 - 0
doc/src/dev/contrib/tor.md

@@ -86,3 +86,23 @@ git config user.email darkfi@darkfi
 
 
 Verify it has been set with `cat .git/config`.
 Verify it has been set with `cat .git/config`.
 
 
+### Commit Timestamps
+
+`git` commits contain two timestamps, the `AuthodDate` and the `CommitDate`.
+These timestamps are retrieved from the system and contain the configured
+timezone. If you want to exclude the timezone information from your commits,
+you may create a `git` alias to use:
+
+```
+git config --global alias.utc-commit \
+'!GIT_COMMITTER_DATE="$(date --utc +%Y-%m-%dT%H:%M:%S%z)" git commit --date="$(date --utc +%Y-%m-%dT%H:%M:%S%z)"'
+```
+
+This allows to explictly use `UTC` date on commits by executing:
+
+```
+git utc-commit -m "{Commit message}"
+```
+
+Alternative, you can use the same alias in your shell configuration for
+`git commit` to always use `UTC` date on all your repos commits.