Back

Explore Courses Blog Tutorials Interview Questions
+3 votes
2 views
in DevOps and Agile by (29.3k points)

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?

1 Answer

+3 votes
by (19.4k points)
edited by

Syntax for git pull is

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

and in the examples section:

Merge into the current branch the remote branch next:

$ git pull origin next

So 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

For more information about installation of git and common git commands please go through the following link:

 

Related questions

Browse Categories

...