specifying git branch for remote

后端 未结 2 1861
攒了一身酷
攒了一身酷 2020-12-24 02:36

I\'m trying to update my webbynode pulling from github but I got the message below:

You asked to pull from the remote \'git@github.com:sigbackup/gsapp

相关标签:
2条回答
  • 2020-12-24 03:08

    What local branch have you checked out?

    What git status shows?

    You are probably working on some other branch than the local master branch. If you want to fetch new commits from github and merge them to the local master branch, you have to:

    git checkout master
    git pull
    

    If you want those commits in the branch, on which you are working, you need:

    git pull origin master
    

    You were close in your try from PS, but the last param should be branch name, not the repo url.


    You can also just fetch new commits from github, and do not merge it into any local branch, with:

    git fetch origin
    

    Then review those changes with git diff, git log, etc, and merge later to the currently checked out branch with:

    git merge origin/master
    
    0 讨论(0)
  • 2020-12-24 03:12

    It's strange that you have a branch called origin. origin is used to name a remote automatically created during git clone; you will get in troubles having to disambiguate origin-the-branch and origin-the-remote. Did you add the branch manually to the .git/config? What commands did you run? I suspect that you messed this up.

    0 讨论(0)
提交回复
热议问题