Agustin Castro
Agustin Castro

Reputation: 459

git upload the files as root

I've created a new repository in GitHub.
Then, I make a commit and push in my terminal.

But all files I add to GitHub have as owner root.
However, in my terminal when I check files permissions with "ls -la" they have 755 for folder and 644 for files with 1000:1000.
Why the owner is root when I use that repository in other project?

Upvotes: 1

Views: 971

Answers (1)

VonC
VonC

Reputation: 1324407

Git will only record 755 or 644 as permission. See "How Git Treats Changes in File Permissions."

And the local file owner is not recorded, which means if it is root when you clone/use a repo, it only reflects the local account you are using when doing those operation: Git knows nothing about it.
So don't use the root account when cloning your repo.

Upvotes: 1

Related Questions