top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why git doesn't track file's "read"/"write" permission?

+2 votes

I just want to know why GIT doesnt track read/write permission? What I want is just GIT keep what every I checked in? ( I am OK with the executable permission control)

posted Aug 26, 2015 by Ahmed Patel

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

It's sort of a philosophical issue. If you are placing a file into a repository, it is by definition "read only". You can never 'write' the same revision, but with a different content - it would be a contradiction. Hence the r/w flags are ignored.

It's important to remember that as concieved, Git is not a deployment tool, so it didn't need r/w permissions, and as open source DVCS, everything checked out would be local so the user would have full control, so read-only couldn't be relied on anyway, and we hope the user will contribute a change/improvement so 'write' it is!

Likewise it doesn't store timestamps (of the files) either..

There is a Linus 'rant' somewhere on the issue..

answer Feb 10, 2016 by Manikandan J
Similar Questions
+1 vote

I have some data files that need to be stored along with source code. These data files are large, but I don't need to keep their versions. I only need to keep the versions of the source code.

git-annex is mainly for large files with version. Therefore, it is not suitable for my situation.

Does anybody know whether there is a way to use git to manage source code (with version) as well data files (without version)?

+1 vote

When run that command immediate after "git bisect start" somebody sees the full commit range as defined in "git bisect start".

However running that command later after few git bisect steps" somebody is just presented with the remaining commit interval. Is this intended ?

+1 vote

I have created one repository (but I'm not a root user on the server) like

$ git init --bare

And I do push my changes locally to remote repo where I created. My friend also working the same repo, and he needs to push the changes on the same.

I tried by adding below line on the remote config file

 sharedRepository = true

Any suggestion?

+1 vote

I'm using git 1.9.1 in Ubuntu 14.04.

I have a repository on github, a clone on my desktop and bare repo on a private server, in my desktop the remotes looks like this

all (fetch)
all (push)
all (push)
server (fetch)
server (push)
origin (fetch)
origin (push)

If I commit to master in my desktop and run 'git push all master', the github and the server repos are correctly updated, but if I run 'git status' the message says:

Your branch is ahead of 'origin/master' by 1 commit.
 (use "git push" to publish your local commits)

The message won't update unless I run git fetch or git push origin master. I'd expect the git status to give me a updated status message after calling 'git push all master'.

–1 vote

Running "git rev-parse --show-toplevel" doesn't print anything when it is run inside .git dir (on all levels)