Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find a url for a local GIT repo

Tags:

git

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?

like image 250
Kye Avatar asked May 09 '13 00:05

Kye


People also ask

How do I find the remote URL for a repo?

If you've copied a project from Github, it already has an origin. You can view that origin with the command git remote -v, which will list the URL of the remote repo.

How do I copy a git repository URL?

On GitHub.com, navigate to the main page of the repository. Above the list of files, click Code. Copy the URL for the repository.

How do I browse local Git repository?

You can find the list of all local git repositories by navigating from “Git > Local Repositories.” Based on the previously configured folder for the local repos, Visual Studio will change the context for the local repositories. Then, you will have all the local repos on your fingertip.

What is repo URL?

A remote URL is Git's fancy way of saying "the place where your code is stored." That URL could be your repository on GitHub, or another user's fork, or even on a completely different server. You can only push to two types of URL addresses: An HTTPS URL like https://github.com/user/repo.git.


1 Answers

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

like image 122
jacob aloysious Avatar answered Oct 20 '22 16:10

jacob aloysious