Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+5 votes
7 views
in DevOps and Agile by (19.4k points)
edited by

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?

4 Answers

+5 votes
by (27.5k points)
edited by

Tip to get only the remote URL:

git config --get remote.origin.url

In order to get more details about a particular remote, use the

git remote show [remote-name] command

Here use,

git remote show origin

For more information about installation of git and common git commands please go through the following link:

 

Git show remote url-How can I determine the URL that a local Git repository was originally cloned from?
Intellipaat-community
by (140 points)
This answer appears in google search result for "git get remote url" and is wrong. You do not need to know configuration tree in order to get remote url.

'git remote show origin' seems to provide the response only when the remote is accessible and is not useful when tracing the problems with remote.

The correct way getting git remote is:
`git remote -v`
0 votes
by (140 points)

To get the remote URL:

git remote -v
0 votes
by (1.5k points)
  • Find the relevant project directory and Open a terminal or command prompt and locate the directory where the project has been cloned.
  • Next, verify the remote origin URL: Execute the following command for checking the url for remote git repository which you are working with.
  • Use the 'git remote -v' command in order to view the URL for the origin remote.

  • The following is the URL for GitHub forks: eg: https://github.com/
  • Go to the main GitHub repository and Look for the repository's that are a fork of this one, Less than.
  • Try the URL which is present in the origin of your local repository and compare with the address of the forks and identify which repository you have cloned.
  • In this manner, you will be able to view clearly the particular fork that you are cloning.
0 votes
by (1.8k points)

Find the relevant project directory and Open a terminal or command prompt and locate the directory where the project has been cloned.

Now verify the remote origin URL:

 

  • Execute the following command for checking the url for remote git repository which you are working with.
  • Use the 'git remote -v' command in order to view the URL for the origin remote.


The following is the URL for GitHub forks:


eg: https://github.com/

  • Go to the main GitHub repository and Look for the repository's that are a fork of this one, Less than.
  • Try the URL which is present in the origin of your local repository and compare with the address of the forks and identify which repository you have cloned.
  • In this manner, you will be able to view clearly the particular fork that you are cloning.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...