Skip to content
Fix Code Error

How can I determine the URL that a local Git repository was originally cloned from?

March 13, 2021 by Code Error
Posted By: Anonymous

I pulled a project from GitHub a few days ago. I’ve since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I determine which of those forks I pulled?

Solution

If you want only the remote URL, or if your are not connected to a network that can reach the remote repo:

git config --get remote.origin.url

If you require full output and you are on a network that can reach the remote repo where the origin resides :

git remote show origin

When using git clone (from GitHub, or any source repository for that matter) the default name for the source of the clone is “origin”. Using git remote show will display the information about this remote name. The first few lines should show:

C:UsersjaredparVsVim> git remote show origin
* remote origin
  Fetch URL: [email protected]:jaredpar/VsVim.git
  Push  URL: [email protected]:jaredpar/VsVim.git
  HEAD branch: master
  Remote branches:

If you want to use the value in the script, you would use the first command listed in this answer.

Answered By: Anonymous

Related Articles

  • Git - Pushing code to two remotes
  • Why do I have to "git push --set-upstream origin "?
  • Git Using Remote Branch
  • Why do git fetch origin and git fetch : behave differently?
  • Why call git branch --unset-upstream to fixup?
  • How do I clone a single branch in Git?
  • What's the difference between git clone --mirror and…
  • How can I find the location of origin/master in git,…
  • How to track untracked content?
  • Is it safe to shallow clone with --depth 1, create…
  • How do you list volumes in docker containers?
  • Git workflow and rebase vs merge questions
  • typescript - cloning object
  • Retrieve specific commit from a remote Git repository
  • How to clone ('fork') your own personal GitHub repo…
  • What is "git remote add ..." and "git push origin master"?
  • Various ways to remove local Git changes
  • Worker Script Failing to Load for Vue Webpack Built App
  • How does origin/HEAD get set?
  • How to pull in changes from skeleton sub-repository…
  • Creating nested dicts with dynamic key and values
  • Push on GIT and Bitbucket
  • Aurelia, navigate is not updating viewport
  • Why am I getting a "401 Unauthorized" error in Maven?
  • Change a Git remote HEAD to point to something…
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • How to remove MySQL completely with config and…
  • Detach (move) subdirectory into separate Git repository
  • Checkout another branch when there are uncommitted…
  • Git push error: "origin does not appear to be a git…
  • Git submodule update
  • What are the differences between git remote prune,…
  • Setting up and using Meld as your git difftool and mergetool
  • Reference - What does this regex mean?
  • Importing a GitHub project into Eclipse
  • “tag already exists in the remote" error after…
  • git pull while not in a git directory
  • Start redis-server with config file
  • Why is Git better than Subversion?
  • GIT clone repo across local file system in windows
  • What is git tag, How to create tags & How to…
  • ExpressJS How to structure an application?
  • fatal: 'origin' does not appear to be a git repository
  • How to backup a local Git repository?
  • Why does Git say my master branch is "already up to…
  • Rails rspec returns no examples found when…
  • Your configuration specifies to merge with the from…
  • Are Git forks actually Git clones?
  • Difference between git checkout --track…
  • Git push: "fatal 'origin' does not appear to be a…
  • Git merge with force overwrite
  • How do I make a Git commit in the past?
  • What is a tracking branch?
  • What exactly does the "u" do? "git push -u origin…
  • How to git-svn clone the last n revisions from a…
  • Is it possible to use pip to install a package from…
  • How to recover stashed uncommitted changes
  • How to use local docker images with Minikube?
  • Why does Git tell me "No such remote 'origin'" when…
  • Remove sensitive files and their commits from Git history
  • Why does git say "Pull is not possible because you…
  • Docker remove TAG images
  • git lfs push to github failure on Ubuntu 18.04
  • What's the difference between HEAD^ and HEAD~ in Git?
  • Egit rejected non-fast-forward
  • XMLHttpRequest cannot load ✘✘✘ No…
  • Correctly configure webpack-dev-middleware with…
  • coercing to Unicode: need string or buffer, NoneType…
  • Why does git status show branch is up-to-date when…
  • Fix top buttons on scroll of list below
  • Git push won't do anything (everything up-to-date)
  • Homebrew install specific version of formula?
  • Git's famous "ERROR: Permission to .git denied to user"
  • How can I switch to another branch in git?
  • DAX Function Using Variables for Efficiency Purposes
  • In plain English, what does "git reset" do?
  • Lodash .clone and .cloneDeep behaviors
  • Backbone View function throws TypeError: object is…
  • Polymer conflict with moment.js?
  • Postgres could not connect to server
  • Remote branch is not showing up in "git branch -r"
  • How do I push a local repo to Bitbucket using…
  • disable vue-cli webpack encoding image base64
  • How can I duplicate slots within a Vuejs render function?
  • How to retrieve a single file from a specific…
  • Why does `this` inside filter() gets undefined in VueJS?
  • How to Deep clone in javascript
  • How do you get git to always pull from a specific branch?
  • How to upload a project to Github
  • How to use terminal commands with Github?
  • Does "git fetch --tags" include "git fetch"?
  • npm ERR! fetch failed status code 502
  • How do I delete a Git branch locally and remotely?
  • webpack-dev-server npm run dev throwing TypeError:…
  • useEffect Error: Minified React error #321 (GTM…
  • How do I clone into a non-empty directory?
  • How do I connect to this localhost from another…
  • Why did my Git repo enter a detached HEAD state?
  • How do I rename both a Git local and remote branch name?
  • Git fetch remote branch

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Get the full URL in PHP

Next Post:

Tab space instead of multiple non-breaking spaces (“nbsp”)?

Leave a Reply Cancel reply

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

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error