-1

When I create a commit in git, does it store any information associated with the device (like IP Address, system details etc...) that I'm creating the commit from?

And if Git (the VCS) doesn't store it, then do any of the Git service providers like GitHub, Bitbucket etc... store the system information?

For example, can anyone get the IP Address of the system that I'm using if I publish a git repository in GitHub and make it public?

Gangula
  • 5,193
  • 4
  • 30
  • 59
  • 1
    As a side note, some of the information in Git's index (aka staging area) may be OS-specific and might allow you to deduce the OS in some cases, but that particular information never goes into any of the *commits*, and the index itself is only visible on your own machine. – torek Nov 15 '22 at 06:25

1 Answers1

2

No, Git does not store this information. Let's check what it does in fact store:

$ git init
Initialized empty Git repository in /home/user/test/.git/
$ echo 'this is a file' > README
$ git add README
$ git commit -m 'Initial commit'
[master (root-commit) 8a4399d] Initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 README
$ git cat-file -p 8a4399d
tree dbf49a0436d9fe83cc1528362959563c5b230ac4
author A Uthor <author@example.com> 1668115302 +0100
committer A Uthor <author@example.com> 1668115302 +0100

Initial commit

That's all that's stored in a Git commit. If it is not the root commit, it will have an additional "parent" line.

As for GitHub: you can use Git without it. It is only contacted when you run git push or git fetch. We can't see their source code, so we don't know. Probably, as part of webserver logs, at least IP address. Not sure what you mean with "system details", but probably not.

knittl
  • 246,190
  • 53
  • 318
  • 364