runawayj
runawayj

Reputation: 29

Should a Git push be uploading files/directories?

I am coming off of a old-fashioned FTP workflow and am having trouble getting a development → staging → production Git process working. I am able to connect to both my staging and production servers via ssh/git.

I created an empty repository on the staging server and attempted to push my local dev repository. This appeared to work. However, the only file that seemed to upload was a big 2+GB file in the .git folder. None of my directories will upload. Is that the way this works or am I doing something wrong? I cannot figure out how to take my local project and push it up to a server the way I am used to doing it in FTP.

Any help is appreciated.

Upvotes: 1

Views: 362

Answers (3)

Andrew Aylett
Andrew Aylett

Reputation: 40760

A standard git push won't actually update the working copy of the repository you're pushing to -- your changes are all there, waiting for you update your working copy manually. This is for safety, in case you're working in your working copy :). Really, git push is the opposite of git fetch, not of git pull -- consider that git fetch also doesn't update your working copy.

You can set up a hook to update your working copy after a push, if that's what you want.

Upvotes: 1

Mike Weller
Mike Weller

Reputation: 45598

Git stores the entire commit tree in large binary blob files ('packs') which you are seeing. By default the server will only store the 'bare' repository so the files aren't actually checked out, and only the compressed pack data is there in the .git directory. You would have to have some post-commit scripts on the server if you want to keep a checked out and update-to-date version of the latest commit somewhere.

Upvotes: 0

MayThrow
MayThrow

Reputation: 2201

Take a look at Codeschool's interactive lesson for github.

http://try.github.io/levels/1/challenges/1

It explains most of the stuff to get your started

Upvotes: 2

Related Questions