0

Assume a remote repo which filesystem is a folder, say MyRepo, that contains other folders, say A1, A2 and A3, and assume that those folders contains a bunch of files that I am tracking. Assume that I want to clone such a repo in C:\Foo , where Foo is a folder. I move into C:\Foo, run git init thus obtaining C:\Foo\.git folder. Then, I clone obtaining

C:\Foo\.git
C:\Foo\MyRepo
C:\Foo\MyRepo\.git
C:\Foo\MyRepo\A1
C:\Foo\MyRepo\A2
C:\Foo\MyRepo\A3

I have two .git folders. My questions are

  1. Is that possible to remove C:\Foo\.git?
  2. In general, does the location of the .git folder makes difference? For example, if I overwrite C:\Foo\.git with C:\Foo\MyRepo\.git would that create problems?
Barzi2001
  • 989
  • 8
  • 24
  • 1
    If you are cloning a repo, you don't need to `init` beforehand. You can delete the `C\Foo\.git` without touching the `MyRepo` repository. – Holloway Feb 06 '15 at 10:57

1 Answers1

1

1.Is that possible to remove C:\Foo.git?

Possible in the sense that you'll lose all information that was in the git metadata in Foo\.git. But I think that you didn't want Foo to be git repo in the first place. Just don't run git init on Foo.

  1. In general, does the location of the .git folder makes difference?

Of course!

For example, if I overwrite C:\Foo.git with C:\Foo\MyRepo.git would that create problems?

Yes, the paths that git stores information to would be changed.

I think this question reflects your lack of understanding what a git repo actually is, I recommend starting with a simple tutorial like this.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94