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.

  • How can I use keyboard shortcuts to do a git commit and push from IntelliJ IDEA?
  • Git (SSH) in Visual Studio 2015
  • How to list all tags along with the full message in git?
  • Git: Merging but overwriting changes
  • Git - Difference between amend and squash commands
  • Truncating SCM (git) URL for maven release tag push
  • Using Git with TFS 2017 - Works in Visual studio but not Command Line
  • What are the differences between GIT and SVN when it comes to merge conflicts solving
  • Pull updates with git after cloned with --depth 1
  • .bash_history does not update in Git for Windows (git bash)
  • git selective revert local changes from a file
  • git push origin hangs after the total message
  • 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.