2

I have cloned development once before and I see it under

 git branch -a

Now I want to do a fresh clone from another directory but I cannot git clone 'development'

How do I get the full clone url from the command line? I could use the bitbucket UI but I would like to be able to grab the url from command line.

gitsensible
  • 551
  • 1
  • 8
  • 19
  • 1
    Possible duplicate of [How can I determine the URL that a local Git repository was originally cloned from?](http://stackoverflow.com/questions/4089430/how-can-i-determine-the-url-that-a-local-git-repository-was-originally-cloned-fr) – Andy Ray May 11 '17 at 04:16

1 Answers1

1

First, you can get the irl with git config --get remote.origin.url, which means, from another directory, you can type:

git clone $(git -C /path/to/first/local/clone config --get remote.origin.url)

You can add -b development if you want that second clone to directly clone the right branch.

Second, you don't have to re-clone everything: with the command git worktree, you can have in another directory a second worktree based on another branch.
See more at "Multiple working directories with Git?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250