Search code examples
macosgitversion-controlrackspace-cloud

Updating from a clone repo to the original repo on my server


I'm sure there's something very simple I'm doing wrong here, so I made these diagrams in the hope that someone can figure it out for me. Basically, I cannot get any new files from my cloned repo to show up on the original repo on the server.

Currently, I have a magento installation on my production server. I made this a --bare --shared git repository then cloned it to my local mac git.

My setup

I understand how to stage and commit within the clone repository, but I assume this is all local, the commits are contained within the mac's repository and don't actually touch the server.

committing within the local mac

This is where something is going wrong, now that I have my local repo in the state I want it, do I push it to the original repo?

Pushing from local to server

Then, I assume I will stage and commit the changes on the server?

staging and committing on server

Last, I realize this is a very basic workflow, but I'd like to master this layout for now before I make things more complex.

Thank you.


Solution

  • After you have stage and committed in your local repo, you have to push to the server:

    git push origin master
    

    where origin is the remote you are pushing to ( automatically setup when you clone) and master is the branch you are pushing.

    Note that you push commits and not files. So once you have pushed, you are done. You don't have to stage and commit on the server.