Question

$ git clone ssh://host/repo.git ~/
destination directory '/home/username/' already exists.

Can anyone tell me how to make this work? I'm trying to quickly be able to replicate common dev scripts and config.

Was it helpful?

Solution

This seems to work:

cd ~
git init
git remote add origin ssh://host/repo.git
git pull origin master

OTHER TIPS

The clone command creates a new directory when you pass a second argument:

$ git clone ssh://host/repo.git ~/your_directory

clone will create ~/your_directory. If the directory already exists it will give you the error you get.

cd ~
git clone ssh://host/repo.git

After that, you have the project in the /home/username/repo/ directory

If you want to have the project in a different folder name (e.g 'foo/')

mkdir ~/foo
cd ~/foo
git clone ssh://host/repo.git foo/

I would clone the repository into a subdirectory:

git clone ssh://your/git/repo.git ~/repo

And create symlinks to the configuration files:

ln -s ~/repo/.bashrc ~/.bashrc
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top