top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Given object file in Git, determine its path, or at least, its contents

0 votes
346 views

I have a brand new, large file in my repository. I know that its object file is:

.git/objects/87266d373359958e4fa9b51808ae076db9303923

I would like to determine the path name it has (and in which commit). I would also like to be able to extract its file contents (somewhat like "git show" would do if I knew its path name).

I'm sure that there are Git commands to do both of these, but with Git manual pages, there's no way to find the command unless I already know its name.

posted May 16, 2013 by anonymous

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

1 Answer

0 votes

To check the file content, you can use git cat-file -p 87266d373359958e4fa9b51808ae076db9303923

answer May 16, 2013 by anonymous
Similar Questions
+1 vote

How to configure a read-only copy of a remote Git repository on a local server in bare mode and automatically synchronize its contents.

I need to configure a mirror of the repository hosted at another location and the mirrored repository should automatically perform syncing of code at regular intervals.

+1 vote

I am new in git and I am trying to understand it.

I have this case:

a. I develop a html file in several days with daily commit.
b. Some weeks after I noticed that I lost part of the code.
c. I located a code 3 commits ago.

then how I can fetch from the remote repository the html file as was 3 commit before (the whole file)?

+1 vote

We're attempting to write some scripts to perform automatic commits for certain files under certain conditions. We wish to use the just committed revision number to perform some other logging operation. The --xml command line option on many of the other commands (info, status, etc.) are fantastic, but the commit command does not allow this.

I'm currently attempting to parse the standard output of the commit message to grab it, but feel this is less than optima as it seems very error prone.

Is there any consideration to add an --xml option to the commit command output or a better programmatic means to grab the commit revision?

$ svn commit 1.txt -m "Checkin message". 
Sending 1.txt 
Transmitting file data . 
Committed revision 3272. 
+2 votes

Is it possible to add custom metadata to Git commit object?
Such metadata should be ignored by Git commands, but could be used by a 3-party tool which knows the format and knows where to look.

I assume that this should be possible, given that Git objects are actually patches, and patches can contain additional details. But can this be done with the help of Git commands?

...