About this question
I have cloned a git repository to my dev server and then switched to the dev branch but now I can't do a git pull to update the branch.
How do I update the code on the server?
I have cloned a git repository to my dev server and then switched to the dev branch but now I can't do a git pull to update the branch.
How do I update the code on the server?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask DevOps Expert
Answered on May 20, 2021
Syntax for git pull specific branch
git pull [options] [ [...]]and in the examples section:
Merge into the current branch the remote branch next:
$ git pull origin nextSo you want to do something like:
git pull origin devTo 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