So I'm using the git clone command but when I try to clone the repository into a specific folder it doesn't create a folder like it does normally. For example when I use it like this
git clone https://github.com/username/repositoryName.git
it creates a folder named repositoryName and stores the repository in there. When I'm using it like this
git clone https://github.com/username/repositoryName.git myFolderName
it doesn't create that default folder it would create. It just saves it in myFolderName. The thing is that I want it stored in that default folder but I want that default folder in myFolderName. I can't use mv command because I don't know the defaults folder name and I clone a lot of repositories at the same time. Any ideas?
Thanks in advance.
What about something like this:
Which will produce your following git repositories:
Note: You don't need to add
.git
at the end of each HTTPS link forgit clone
.If you need to include
.git
for some reason, you can strip it with:Assuming that
myFolderName
already exists the simplest solution is this:You should be able to do it with,
PS: This is how you could split the repository name from the URL