Kye
Kye

Reputation: 6279

How to find a url for a local GIT repo

In our Development environment, I can see that the GIT repository was cloned from TEST,

In the config file,

[remote "origin"]
   url = //foo/test-foo-project
   fetch = +refs/heads/master:refs/remotes/origin/master

I now want to pull the repository in Development, to my local instance. I know //foo/test-foo-project isn't a real path.. But I can determine which URL to use?

Upvotes: 37

Views: 75453

Answers (3)

Shinya Ohtani
Shinya Ohtani

Reputation: 37

Simply you can find a url for a local GIT repo by giturl command.

$ gem install giturl
$ giturl .
https://*****/

Upvotes: -2

jacob aloysious
jacob aloysious

Reputation: 2597

Git command that could get you the url from origin

$git config --get remote.origin.url

But you would not be able to set a new path

$git config remote.origin.url "newPath"

This would fail with the message error: could not lock config file ./config: File exists

Upvotes: 48

Wojciech Bednarski
Wojciech Bednarski

Reputation: 6373

In your home directory do less .shh/config then you can see the URL for foo.

If it is not there you can try git remote show and then probably git remote show origin.

Do you remember how you cloned this repo, can you past the command here?

Upvotes: 2

Related Questions