Skip to contentSkip to conversation

gmock issues when switching Git branches

DISCUSSION Wido den Hollander 2 participants 2 messages Dec 13, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I've been seeing this multiple times when switching Git branches on git Git repo:

wido@wido-desktop:~/repos/ceph$ git branch
  firefly
  hammer
  jewel
* master
wido@wido-desktop:~/repos/ceph$ git checkout jewel
error: Updating the following directories would lose untracked files in it:
	src/gmock

Aborting
wido@wido-desktop:~/repos/ceph$

The gmock submodule is often preventing me from switching branches.

Since I don't work with Git submodules that much I usually end up removing the directory and going a submodule update.

Is that the good way to go? And am I the only one running into this?

Wido

#1 lore raw
Quoted 13 lines · Wido den Hollander

Hi,

I've been seeing this multiple times when switching Git branches on git Git repo:

wido@wido-desktop:~/repos/ceph$ git branch
  firefly
  hammer
  jewel
* master
wido@wido-desktop:~/repos/ceph$ git checkout jewel
error: Updating the following directories would lose untracked files in it:
	src/gmock
Quoted 7 lines

Aborting
wido@wido-desktop:~/repos/ceph$

The gmock submodule is often preventing me from switching branches.

Since I don't work with Git submodules that much I usually end up removing the directory and going a submodule update.

That's what I do too. :) The problem is that the submodule structure changed after jewel.

Quoted 1 line

Is that the good way to go? And am I the only one running into this?

I just keep a separate checkout for jewel (and each other release), e.g.

git clone [email protected]:ceph/ceph ceph.jewel
git clone [email protected]:ceph/ceph ceph.hammer

That reduces the amount of rebuilding I have to do (at the expense of disk space).

sage