Git pull origin master returns fatal: invalid refspec

Here is the problem:

Whenever I do

$ git pull 'https://github.com/username/reponame.imtqy.com.git'

followed by url. I have no problem, but when I do

git pull origin master 'https://github.com/username/reponame.imtqy.com.git'

followed by a url, it returns

fatal: Invalid refspec 'https://github.com/username/reponame.imtqy.com.git'

What does this mean and how do I fix it?

+4
source share
2 answers

If you have already installed remote tracking branches (that git cloneis, it does this automatically) and want to use git pullto capture and merge the latest commits for the current branch from a remote repository, I believe that the following is enough:

git pull

To achieve the same effect with refspec enabled (too long):

// Pulls the remote 'master' branch down to the local 'master' branch
git pull origin master:refs/remotes/origin/master

, URL- refspec.

, refspec , Pro Git book. , !

+3

, , git pull origin master 'https://github.com/username/reponame.imtqy.com.git' ( )?

"master" URL-,

git pull https://github.com/username/reponame.imtqy.com.git master

"origin" - "named remote", , URL- .

git pull

git pull [<repo> [<refspec> ...]]

[...] ;— . .

+3

All Articles