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?
Asked
Active
Viewed 1,557 times
0

Hanz
- 499
- 7
- 18
-
I fail to see a question here – hd1 Aug 09 '19 at 03:15
-
@hd1, updated my question – Hanz Aug 09 '19 at 03:21
2 Answers
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 begit 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.
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