M
M
maksat19912016-12-19 00:19:52
git
maksat1991, 2016-12-19 00:19:52

How to track a branch in git?

There is a remote origin repository with a devbranch branch.
I create a local branch with git branch devbranch
Now we need to have the local devbranch track the remote branch origin/devbranch.
What command is used for this?
I know that it was necessary to create a branch like this: git checkout -b devbranch origin/devbranch, and it would automatically track. But since I have already created my local branch in a different way, then I need a command that will make my local branch track the remote one

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2016-12-19
@toxa82

git branch --set-upstream-to=server-alias/branch branch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question