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?
On the GitHub website, click on you repository of interest. Locate the green button named Code and click on it. The GitHub URL will appear.
Getting The Remote URL For a Git Repository If you're unsure what the remote is called, simply run “ git remote ,” which will print all of them.
A typical default shortname is "origin": this is used for the remote which your local repository was cloned from.
In Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository's URL - and thereby makes referencing much easier.
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:\Users\jaredpar\VsVim> 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.
Should you want this for scripting purposes, you can get only the URL with
git config --get remote.origin.url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With