Boost logo

Boost :

Subject: Re: [boost] [git] Effect of "git checkout develop" on submodule?
From: Daniel James (daniel_at_[hidden])
Date: 2013-12-02 14:36:04


On 2 December 2013 19:14, Beman Dawes <bdawes_at_[hidden]> wrote:
> On Mon, Dec 2, 2013 at 1:09 PM, Daniel James <daniel_at_[hidden]> wrote:
>
>> Oh, I just tried it and git now creates a local branch if you try to
>> checkout a remote branch with no local copy. I don't think it used to
>> do that.

FWIW this was introduced in git 1.6.6. If you check out a branch that
doesn't exist locally, but does on a single remote, it automatically
creates a local branch.

>> You are checking out a local branch here, you need to merge or pull
>> the remote branch. You can tell when it's checking out a remote branch
>> because it says something like, "Branch develop set up to track remote
>> branch develop from origin."
>>
>
> OK, did this: "git checkout -B develop remotes/origin/develop"
>
> Got the message you indicated.

The problem with this is that you might overwrite some local changes
on accident. It's better to do:

git checkout develop
git pull

Which will pull the latest changes from the remote branch into the local branch.

Btw. you can usually just write 'origin/develop' rather than
'remotes/origin/develop'.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk