Technology

#How to View the Remote URL a Github Repository Was Cloned From – CloudSavvy IT

“#How to View the Remote URL a Github Repository Was Cloned From – CloudSavvy IT”

If you’ve cloned a fork of a Github repository, it might have the same name as many other forks. Which one did you pull from? Rather than digging through your browser history, you can use Git’s built in tools to view the URL it’s connected to.

This Doesn’t Work For “Download ZIP”

Note: if you’ve downloaded a Git repo using the “Download ZIP” button, you won’t be able to view the remote URL. You will have to search for “github.com” in your browser history, and compare the latest commits.

This is because downloading a ZIP from Github comes disconnected from Git, and without any Git history at all. In most cases, you will want to clone the repository properly. If you’re unsure, check for a hidden .git folder in your repository. Otherwise, all commands will fail, because it isn’t set up as a Git repo.

Getting The Remote URL For a Git Repository

Git stores remote URLs in objects called “remotes,” which track the fetch/push URL as well as all of the remote branches, which are usually set up with git pull and git push to use your local branches.

You can get all the information about a remote, including the configured URL, using remote show:

git remote show origin

origin is the default for almost all repositories, but it may be named something else. If you’re unsure what the remote is called, simply run “git remote,” which will print all of them.

This requires you to be online and authenticated with Github. If you want to fetch the URL offline, you can also get it from Git’s config system, or from the newer command remote get-url:

git config --get remote.origin.url

git remote get-url origin

If you liked the article, do not forget to share it with your friends. Follow us on Google News too, click on the star and choose us from your favorites.

For forums sites go to Forum.BuradaBiliyorum.Com

If you want to read more like this article, you can visit our Technology category.

Source

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close

Please allow ads on our site

Please consider supporting us by disabling your ad blocker!