Naming both a top-level directory and a branch "net" is a bit unfortunate


Paul Sokolovsky
 

Hello,

Today I tried to figure why I got my Zephyr repository clone in an
inconsistent state, and here's what I found:

Git for quite a few years allow to checkout a remote's repository with:

git checkout <short-remote-name>

e.g.

git checkout net

is supposed to just checkout origin/net if didn't have it already, and
set it up a tracking remote branch.

Well, that doesn't work with Zephyr, because there's "net" top-level
directory. It's easy to overlook that "git checkout net" didn't produce
a notice of switching to another branch/setting up tracking, and wonder
why you didn't have the latest net's commits in git log. My next step
was to pull these branch changes explicitly: "git pull --rebase origin
net", and that's how I ended up with net's commit in my master branch.


I hope it's just me, but posting this in case someone else will have a
similar problem (or if maintainers get similar hard-to-explain reports
of "my local repo got messed up!").

The solution is to use explit --track option:

git checkout -b net --track origin/net

(I didn't have to use --track explicitly for a couple of years).


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

Join devel@lists.zephyrproject.org to automatically receive all group messages.