git pull generates “fatal: No remote repository specified.” error

I want to start contributing to a project hosted on Github. I have taken the following steps:

  1. git init
  2. git pull

The pull command succeeded and the files where copied to my local directory. But when I try git pull again, then I get the following error

  • Syncing a fork in Bitbucket, Branches and are they synced?
  • Add git hook to repo
  • Is it possible to communicate two local git-repos?
  • Commit a change to more than one branch in Git
  • What workflow should I follow to use and update a Pimcore instance in multiple computers, while using GIT?
  • Using Maven, Git: How do I tag the latest version of my code?
  • “fatal: No remote repository specified. Please, specify either a URL or a
    remote name from which new revisions should be fetched.”

    I did not get this error when I pulled from and pushed to other Github repositories in the past. What is the problem and how can I fix it? Could it be because I have pulled the same repository to a different local directory in the past? In either case, what should I do to fix the problem?

  • GIT :: Merging 2 branches overwrite the content in one branch with the other
  • Ignore a file in git but have it downloaded when the project is cloned
  • How to work with other person on one branch in Git?
  • git pull errors
  • Gitweb: How I see source code in tree view with color
  • how to identify branches that need to get merged in git
  • 4 Solutions collect form web for “git pull generates “fatal: No remote repository specified.” error”

    You should always start with a git clone (and I’d suggest you do that), but if you want to continue from here, here’s the way:

    You can use git remote add origin to add a remote, and set its name to origin. You can check this tutorial if you want to know more. This, I hope, will fix your problem. If you encounter other problems, just do a git clone.

    You need to follow the correct steps.

    You already did git init, then you should have added remote by doing this.

    git remote add origin

    Now the working tree can recognize origin so

    git pull origin master

    That’s all and I hope it would be helpful to you.


    According to git’s command line:

    If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> <local branch>

    This would allow you to simply run “git pull” instead of “git pull origin branch”

    first do git remote add origin

    then do git pull origin
    here is a good tutorial

    but if you use git clone it will create automatically the originfor you.

    Git Baby is a git and github fan, let's start git clone.