-1

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

Chandana
  • 21
  • 1
  • 7
  • 1
    Please edit your question and show us the exact commands (or steps, if you're using a GUI Git tool) which you performed to get you to this state. – Tim Biegeleisen Dec 14 '17 at 05:54

3 Answers3

1

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
bigbounty
  • 16,526
  • 5
  • 37
  • 65
0

Here is the solution:

git clone -b <branch> <remote_repo>

Arthur Guiot
  • 713
  • 10
  • 25
0

You need to verify your current remote by doing git remote -v and you will see to which remote repositories you are pointing your files; when you are on your develop branch and have made the git pull origin master and git push -u origin master, switch to master branch and merge: git merge myDevelop branch. Hope it helps.

Manuel Pérez
  • 35
  • 1
  • 3