-1

So I'm trying to clone a repo from here

https://github.com/nglglhtr/getter-setter

I created a new folder FirstDapp and opened git gui here then opened git bash from there

enter image description here

then I entered:

git clone https://github.com/nglglhtr/getter-setter

then the bash terminal said: fatal: working tree 'D/.../FirstDapp' already exists

so I tried the solutions from here:

Exception "working tree already exists" while cloning GIT repo in pre-push hook

but those didn't work. Any ideas?

torek
  • 448,244
  • 59
  • 642
  • 775

1 Answers1

1

When you run:

git gui

the GUI will search for an existing Git repository in Git's usual fashion:

  • Is there a repository here, in the current working directory?
    • If so, that's it, and stop.
    • If not, try "climbing up one level", e.g., from /path/to/current/dir, remove the /dir part leaving /path/to/current, and start over.

If this runs out of places to look, git gui opens a smaller, different-looking window and offers you a chance to clone or create a repository.

(There are step I'm omitting on purpose here to simplify things, in that Git won't keep going after certain points, and under certain conditions, but these generally won't apply to your case.)

Since you did:

mkdir FirstDapp
cd FirstDapp

(or the Windows equivalent) and did not run a subsequent:

git init

there must not be a Git repository at the FirstDapp level, but Git-GUI found one, so there must be a Git repository at a higher level. This is the repository that Git-GUI opened.

To get around that problem, you should create—with git init or git clone—a repository within the FirstDapp directory:

git clone https://github.com/nglglhtr/getter-setter

for instance. Then running git gui will find that repository. If you create an empty one, you'll need to do all the remaining steps that git clone would do, so it will be easier to use git clone.

(As an aside, Git-GUI is not generally recommended. It's a bit of a toy example, rather than a real GUI. I personally dislike GUIs in the first place and will avoid them whenever I can, and recommend that you do the same, but tastes differ.)

torek
  • 448,244
  • 59
  • 642
  • 775