1
21
Git stories (programming.dev)
submitted 1 month ago by [email protected] to c/[email protected]
2
25
submitted 2 days ago by [email protected] to c/[email protected]
3
11
submitted 2 days ago by [email protected] to c/[email protected]
4
6
submitted 5 days ago by [email protected] to c/[email protected]
5
1
submitted 5 days ago by [email protected] to c/[email protected]
6
6
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]

Git records the local timezone when a commit is made [1]. Knowledge of the timezone in which a commit was made could be used as a bit of identifying information to de-anonymize the committer.

Setting one's timezone to UTC can help mitigate this issue [2][3] (though, ofc, one must still be wary of time-of-day commit patterns being used to deduce a timezone).

References

  1. Git documentation. git-commit. "Date Formats: Git internal format". Accessed: 2024-08-31T07:52Z. https://git-scm.com/docs/git-commit#Documentation/git-commit.txt-Gitinternalformat.

    It is <unix-timestamp> <time-zone-offset>, where <unix-timestamp> is the number of seconds since the UNIX epoch. <time-zone-offset> is a positive or negative offset from UTC. For example CET (which is 1 hour ahead of UTC) is +0100.

  2. jthill. "How can I ignore committing timezone information in my commit?". Stack Overflow. Published: 2014-05-26T16:57:37Z. (Accessed: 2024-08-31T08:27Z). https://stackoverflow.com/questions/23874208/how-can-i-ignore-committing-timezone-information-in-my-commit#comment36750060_23874208.

    to set the timezone for a specific command, say e.g. TZ=UTC git commit

  3. Oliver. "How can I ignore committing timezone information in my commit?". Stack Overflow. Published: 2022-05-22T08:56:38Z (Accessed: 2024-08-31T08:30Z). https://stackoverflow.com/a/72336094/7934600

    each commit Git stores a author date and a commit date. So you have to omit the timezone for both dates.

    I solved this for my self with the help of the following Git alias:

    [alias]
    co = "!f() { \
        export GIT_AUTHOR_DATE=\"$(date -u +%Y-%m-%dT%H:%M:%S%z)\"; \
        export GIT_COMMITTER_DATE=\"$(date -u +%Y-%m-%dT%H:%M:%S%z)\"; \
        git commit $@; \
        git log -n 1 --pretty=\"Autor: %an <%ae> (%ai)\"; \
        git log -n 1 --pretty=\"Committer: %cn <%ce> (%ci)\"; \
    }; f"
    


Cross-posts:

7
20
submitted 3 weeks ago by [email protected] to c/[email protected]
8
28
submitted 3 weeks ago by [email protected] to c/[email protected]
9
24
How Does Git Store Files? (blog.git-init.com)
submitted 1 month ago by [email protected] to c/[email protected]
10
28
submitted 1 month ago by [email protected] to c/[email protected]
11
8
submitted 1 month ago by [email protected] to c/[email protected]
12
8
submitted 1 month ago by [email protected] to c/[email protected]
13
20
submitted 1 month ago by [email protected] to c/[email protected]
14
22
submitted 1 month ago by [email protected] to c/[email protected]
15
32
submitted 1 month ago by [email protected] to c/[email protected]
16
17
submitted 1 month ago by [email protected] to c/[email protected]

I think it's generally agreed upon that large files that change often do not belong while small files that never change are fine. But there's still a lot of middle ground where the answer is not so clear to me.

So what's your stance on this? Where do you draw the line?

17
2
submitted 1 month ago by [email protected] to c/[email protected]
18
2
submitted 1 month ago by [email protected] to c/[email protected]
19
20
submitted 1 month ago by [email protected] to c/[email protected]

Coming from CVS and ClearCase it took me some time to adopt to Git. The fact that it was distributed was confusing at first, for example, because I thought that would cause chaos. But the way we used it was actually not "that distributed". But once I understood how it worked, not doing DVCS was "the wrong way" immediately.

20
17
submitted 1 month ago by [email protected] to c/[email protected]
21
16
submitted 1 month ago by [email protected] to c/[email protected]
22
9
submitted 1 month ago by [email protected] to c/[email protected]
23
28
submitted 2 months ago by [email protected] to c/[email protected]
24
11
submitted 2 months ago by [email protected] to c/[email protected]
25
37
submitted 2 months ago by [email protected] to c/[email protected]
view more: next ›

Git

2814 readers
3 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 1 year ago
MODERATORS