0

I checkout to develop branch, and run git pull, I got error of fatal: 'develop' does not appear to be a git repository. Instead, I have to do git pull origin develop. Why is that so? Something is wrong with my git setup?

Hanz
  • 499
  • 7
  • 18

2 Answers2

1

You've not configured a default remote for the branch. Do so using git pull origin -u develop.

hd1
  • 33,938
  • 5
  • 80
  • 91
1

Whether or not you have configured the default remote branch, the syntax of git pull is:

  • false in your question: git pull [<options>] [<repository> [<refspec>…​]]
    That would be

    git pull origin develop
    NOT: git pull develop
    

The first argument is the name of the remote repository, and, as the error message indicated, "develop" is not a remote repository. origin is.

  • false in hd1's answer: git pull -u does not exists.

    git push -u origin develop
    

That last command would have establish a link between the local branch develop and the remote tracking branch origin/develop.

In your case, since you want to pull and not push:

git fetch
git checkout --track origin/dev

If the local branch develop already exists, see "Make an existing Git branch track a remote branch?":

git branch -u origin/develop develop
git checkout develop
git pull
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • this `git branch -u origin/develop develop` fixed my issue, but I have no clue when did I broke this – Hanz Aug 09 '19 at 10:16