jospratik
jospratik

Reputation: 1674

git remote branch bringing to local with different ssh machine

there are 2 machines, which i use.

i have cloned one git repository of application which i work on.

on machine A i have cloned this repo, have worked on various features on different branches which i created and committed and pushed remotely.

So remotely i have 3 branches now, one is the master, rest 2 branch1, branch2 of my features.

on machine 2 i have cloned the repository 'master' branch.

my question is how i get the branch1, branch2 on my machine 2 .

so that i can commit stuff from machine 2 too.

thanks in advance.

(sorry for bad english)

Upvotes: 0

Views: 205

Answers (1)

dyng
dyng

Reputation: 3074

you can

git fetch --all
git branch -r # will list all remote branches
git checkout <branch> # notice that the branch name should not have leading 'origin', it is the *local* branch name

git will create local branch tracking the remote branch with same name.

Also check this.

Upvotes: 3

Related Questions