Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git connect my local branch with remote

Tags:

git

In my local repo if I execute

$git branch --all

it returns

* master
  remotes/origin/develop
  remotes/origin/master

that means that I have a local branch named repo and 2 remote branches.

If I do

$git checkout -b develop

it will create a local branch that is unrelated to remote branch .

The command

$git pull origin develop

it will connect my local branch with remote branch?

like image 780
KostasA Avatar asked Dec 02 '22 11:12

KostasA


1 Answers

If by "connect" you mean you want your local branch to track the remote branch, then you need to have your branch --set-upstream

git branch --set-upstream develop origin/develop

Then things like git pull and git status will know which remote branch to track.

like image 132
Cory Kramer Avatar answered Dec 11 '22 07:12

Cory Kramer