Oh, That's How Git Clone Works...
Before, I was making my directory structures way more complicated then they needed to be. I had a main "git repositories" folder, and then inside of that I would use mkdir to create a new folder for each project. Then I would cd inside of that and run:
The problem with doing this is that now you have basically a MyProject folder that you created your self, and inside of that is the MyProject folder that is the root of your repo. Inside of this second folder are the files you probably care about. It's not that big of a deal, but I can be pretty annoying to have to work with longer file paths for no reason. Also, it just means you don't fully understand how git clone works.
When this command is run inside of a folder (let's call it folder a), it creates all of files in the entire repository (with root folder b) inside of it's own folder inside of folder a. Folder a has no .git file and is not part of source control. That means if you have a main "Git-Projects" folder in your home directory, you should cd into the Git-Projects folder and run git clone from that folder every time. This should clone the projects nicely with a single folder containing all the files inside of the main Git-Projects directory.
Your comment will be posted after it is approved.
Leave a Reply.
The posts on this site are written and maintained by Jim Lynch. About Jim...