Git local branch associated with remote branch

Source: Internet
Author: User
Tags using git

When clone finishes the repository and switches to the development branch, a hint appears after using Git pull-r to pull and merge branches:

$ git pull-r
From Ssh://192.168.1.226:29418/ethank-server
Bc86d14. B72fc88 Dev-and Origin/dev
There is no tracking information for the current branch.
Please specify which branch the want to rebase against.
See Git-pull (1) for details

Git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

Git branch--set-upstream-to=origin/<branch> Dev

This is due to the fact that the local branch is not associated with a remote branch, and the association adds a similar entry in. Git/config:

[branch "master"]
Remote = origin
Merge = Refs/heads/master

We follow the prompts to execute the command: Git branch--set-upstream-to=origin/dev Dev

After execution, the. git/config file is incremented:

[branch "Dev"]
Remote = origin
Merge = Refs/heads/dev

You can then use Git pull-r

But if you manually first git fetch and then git rebase origin/dev manual merge, the error will not pop up.

Suggest or use Git branch--set-upstream-to to associate a remote branch

Git local branch associated with remote branch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.