This is probably quite a newb question, but I can't seem to figure it out.
Here's what I did...
On the server (via ssh):
- Created a site on a dedicated server
- Created a git repo there (
git init
I think?) - Added and committed everything
At my office:
- Cloned the repo on my development machine
- Pulled everything
- Made some changes to local files
- Added the files again (is this right? not like svn!)
- Did a commit
- Did a push
...now, on the server, if I do git show
, it shows a diff where the server's last copy of stuff is removed and the stuff I pushed from my office is being added. That's what I want to happen. What I can't figure out is: what do I need to do on the server to make the changes I pushed from my office become "live?"
I've had pretty good success deploying websites with svn in the past, and I figure I can get away with it with git too... but obviously I'm missing some piece of the puzzle. Thanks for any help.
edit - I just noticed this post: http://stackoverflow.com/questions/286988/git-pulling-changes-from-clone-back-onto-the-master
Should I be pulling my office repo onto my server instead of pusing it there? So ssh from the office into the server and then have it git+ssh back into the office to pull that repo? That seems kind of crazy, I'd rather figure out how to make the push go through if possible.
rephrasing the question
I really just want to apply the patch shown by git show
. Does git have a built-in way of doing that?
answer
It looks like git checkout -f
on the server did what I wanted, but creating a --bare repo would have been a better way to go (I've changed to this setup now).