Search code examples
gitbranchgit-remote

git remote -v explanation


I'm using git remote -v to see my remote repository.

myname@DESKTOP-0SD47KB MINGW64 ~/Desktop/maevenNetbeans/MyProject(master)
    $ git remote -v
    origin  https://github.com/Myname/MyProject.git (fetch)
    origin  https://github.com/Myname/MyProject.git (push)
    origin2 https://github.com/Myname/MyProject(fetch)
    origin2 https://github.com/Myname/MyProject(push)

When i created the repository, i linked only one remote repository.

My question is why i'm getting two linked remote repisotory?

What is the meaning of the fetch and push keywords in this context. I know that pushing is for sending and fetching is for retrieving.

is the origin2 a local repository?


Solution

  • origin2 is simply the result of (possibly by mistake) a git remote add:

    git remote add origin2 https://github.com/...
    

    Since the URL is the same as origin, a git fetch will not fetch twice.

    As commented, a simple git remote remove origin2 would rectify the issue.