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

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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?

Answers

If referential integrity has been broken:

git config --get remote.origin.url

If referential integrity is intact:

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: git@github.com:jaredpar/VsVim.git
  Push  URL: git@github.com: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.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/4089430/how-can-i-determine-the-url-that-a-local-git-repository-was-originally-cloned-fr

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils