Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Git /

Cloning

After working on a project for a while, there comes a time when either someone else wants a version, or you want to work on it from a different computer. That is what cloning is for: Creating an exact copy of your repository somewhere else.

An odd quirk of git, it does not allow you to export your work to a remote computer very easily. Instead, you have to be on the remote computer and import your work.

So log onto whichever computer you want a version of your repo on (either physically being at the computer, or using SSH, then navigate to where you want the repo to be and type:

git clone username@server/path/to/repo .

This will copy the top level of the repo in your current directory. It is possible to copy the repo to another location by replacing the . with a path.

Conveniently, git will setup the new repo to look at the old repo as origin, so you can push and pull to it easily.

It does not work the other way however and the remote repo is entirely unaffected. You have to manually setup the original repo to track the new one.

Edit - History - Print - Recent Changes - Search
Page last modified on December 06, 2018, at 03:44 PM