A co-worker created a branch
call feature/validateEmail
. I want to do pull
or checkout
of that branch
on my machine so I can work on it but not wait for it to do merge
a develop
or a master
.
I have tried without success:
git checkout feature/validateEmail
git checkout validateEmail
git pull feature/validateEmail
git pull validateEmail
And since I use the plugin Ioh my zsh
also tried:
gco feature/validateEmail
gco validateEmail
branch
I can see it with :
gba
(by plugin)git branch -a
How can I pull or checkout the remote repository on my machine?
You must first do a fetch
Fetch fetches the remote branch, in your case your partner's, and stores it inside
<remoto>/<rama>
Pull is a combination of fetch+merge When you do the
fetch
you can docheckout
to that branch inside the remote without mixing it with a local one and then domerge
. Another quick option would also be to create a branch locally, makecheckout
to that branch, and then pull from the remote branch.The problem with
pull
how you phrase it in your question is that it does both fetch andmerge
auto-fetch from that branch to the branch where it is currently located.For your specific case you would do:
Then you go into that remote branch with:
And you make the changes you need to then do
merge
with master or with any other branch.You would have to do a fetch first
If your remote is origin:
git fetch documentation
If what you want to do is a clone of the repository, you would have to add the repository as remote: