Mariton
Mariton

Reputation: 621

How do you pull a branch from staging when you are in production using git?

So after switching and pulling the latest from production branch using:

git checkout production and then 
git pull origin production 

I switched to branch feature/slides using

git checkout feature/slides

I know this is silly but How do I pull the latest from feature/slides located on the remote staging repository? I tried

git pull origin feature/slides

But that doesn't seem to update the code on in local environment or do anything.

Upvotes: 3

Views: 12616

Answers (1)

Code-Apprentice
Code-Apprentice

Reputation: 83527

You need to configure staging as a remote in your local repository. You do this with the git remote command:

git remote add staging <remote URL>

Now you use this remote with git pull and git push commands just as you do origin:

git pull staging feature/slides

Upvotes: 4

Related Questions