Search code examples
githubgit-pushgit-pull

How to pull code which is in develop branch git bub


I am new to GitHub and I am trying to pull code from develop branch (just another branch) from git hub but its download the code from master branch, which command I should use to get the code from develop branch. pls anyone can explain this. thank u

and whenever I tried to push code I will get the error like this enter image description here


Solution

  • See the git-pull man page:

    git pull [options] [<repository> [<refspec>...]]
    

    and in the examples section:

    Merge into the current branch the remote branch next:

    $ git pull origin next
    

    So I imagine you want to do something like:

    git pull origin dev
    

    To set it up so that it does this by default while you're on the dev branch:

    git branch --set-upstream-to dev origin/dev