How do I clone my git reposity to a remote machine?

I have a git repo set up on my computer. I also have a remote machine that I can ssh into. I want to clone the repo to the remote machine (and then keep them in sync with push and pull). How do I do this? I’ve only ever cloned from GitHub.

  • GitZilla's update hook error?
  • How do I save a `git reset`
  • Does github require each committer to have their own fork of the project?
  • Gitolite git clone error
  • Unable to push in Git. Why?
  • Selective access to Git repository based on SSH
  • How do I setup Cordova?
  • GitLab specific merge request
  • How to determine if a remote git repo is “safe” to pull from
  • How to checkout only one file from git repository ('sparse checkout')?
  • git workflow laptop-desktop-github
  • How to get rid of some changeset in Hg?
  • One Solution collect form web for “How do I clone my git reposity to a remote machine?”

    1) Initialize bare git repository on remote machine.

    ssh remote_machine
    mkdir my_project
    cd my_project
    git init --bare
    git update-server-info # If planning to serve via HTTP

    2) Configure local repo to be able to pull/push from remote one.

    git remote add origin git@remote_machine:my_project.git
    git push -u origin master

    Now both machine are in sync.

    Git Baby is a git and github fan, let's start git clone.