Ryan
Ryan

Reputation: 8241

Cannot pull changes from master branch

I'm working on a project with a friend and we each have separate branches, along with the master branch that hasn't been touched. I'm trying to merge my branch (called "dave") with the master branch. However, I get the following error:

Daves-MBP:project1 davesmith$ git pull master
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Does anyone know what is going on here and how to fix this?

Upvotes: 1

Views: 8483

Answers (2)

Dm3Ch
Dm3Ch

Reputation: 761

I think you forgot to specify the repository.

Upvotes: 0

VonC
VonC

Reputation: 1327184

Depending on the branch you are, you would need at least:

git pull origin master:master

If master tracks origin/master (see git branch -avv), then this would be enough (since pull uses by default the remote repo named 'origin')

git checkout master
git pull

Note that doesn't merge dave to master, it only update or merge origin/master to master.

A merge would be:

git checkout master
git merge dave

But it is good practice indeed to first update master (to get the most up-to-date version from the remote repo), before merging another branch in the local (updated) master branch.

Upvotes: 1

Related Questions