Search code examples
ubuntugazebo-simu

error : destination path 'gazebo' already exists; when trying to clone model repository for gazebo robotics simulator


i,m using Ubuntu 20.04 and installed Gazebo11

when i tried to download (clone) gazebosim models repository for 1st time after installation (to use them when i,m offline and have no internet connections) using this command in terminal :

git clone https://github.com/osrf/gazebo

i got this error :

fatal: destination path 'gazebo' already exists and is not an empty directory

would you please help me by step-by-step instructions?


Solution

  • If you do a git clone without further arguments it will try to clone the repo into the directory named like the repo. In your case such a directory existed already on your machine (in the directory you are currently in). Hence the error message that it already exists.

    So you could either move the directory elsewhere (mv gazebo gazebo-bak), remove it (rm -rf gazebo) or clone to another location (git clone https://github.com/osrf/gazebo gazebo-new).

    From your question it's not completely clear what you wanted to achieve. Perhaps you just wanted to update the repository previously cloned already. In this case just go into the repo dir and run a git pull:

    1. cd gazebo
    2. git pull