0

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?

Curious guy
  • 13
  • 1
  • 8
  • Does this answer your question? [How to get Git to clone into current directory](https://stackoverflow.com/questions/9864728/how-to-get-git-to-clone-into-current-directory) – ChrisGPT was on strike Sep 13 '21 at 00:40

1 Answers1

0

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
Stefan Horning
  • 1,117
  • 13
  • 17
  • Sorry for unclear part of my question. I found the reason caused the issue and it's solution and posted here – Curious guy Sep 14 '21 at 12:39
  • Thanks Stefan Horning for your answer The problem is : when you install the gazebo, there is a directory named "models", and contained two other directories that are two basic models of gazebo, which are "sun" & "ground_plane". and forasmuch as these two directories exists in model repository in Github, when you trying to clone it, this error shows up The solution that i tried is to remove that two directories (and their contents) then clone the models. sorry that i can't vote-up your answer because i haven't enough reputation – Curious guy Sep 15 '21 at 13:39