tags:

views:

140

answers:

3

Basic question about the way git works.

I clone a repo, make some changes, commit and push the changes back to the original repo.

When I do a git log, the commit message shows up, but the actual files aren't in the directory.

Should they be there?

+3  A: 

they should be in .git (the actual repo). The outer folder is not a repo, it's a work directory.

btw. The man page says:

DESCRIPTION

Updates remote refs using local refs, while sending objects necessary to complete the given refs.

You can make interesting things happen to a repository every time you push into it, by setting up hooks there. See documentation for git-receive-pack(1).

SpliFF
So how would I get them to show up in the working directory?
Cato Johnston
If it's a bare repo, you don't. There is no working directory for them to show up in. If you want them to show up in a working directory somewhere, you need to clone the bare repo into a regular working-copy repo.
JesperE
+2  A: 

You should read up a little on the difference between a bare repository and a repository with a working copy. Bare repos consists of the .git directory (which may or may not be called ".git"), which is just the repository database, without the working copy. Such repos are typically used when you want to publish your changes for others to pull. I think the official recommendation is to push only to bare repositories.

If you push to a bare repositories, your files will not appear in any working copy (except in your own repo, of course). However, they will appear in the repo, but only as database objects. So if you try to find your files in the bare repo, you will only find a bunch of administrative files and files named after sha1 checksums.

JesperE
Those files named after the sha-1 are the compressed files, trees and commits that are expanded into working directory files.
Abizern
A: 

Edit: Actually it looks like changing your post-update hooks is the proper way to do this.

If you really need to do this you can: git reset --hard or git stash

This is probably not the recommended way, but will have the desired effect.

devrand