Early in embryonic development, the embryo has three germ layers and abuts a yolk sac. During the second week of development, the embryo grows and begins to surround and envelop portions of this sac. The enveloped portions form the basis for the adult gastrointestinal tract. Sections of this foregut begin to differentiate into the organs of the gastrointestinal tract, such as the esophagus, stomach, and intestines.
During the fourth week of development, the stomach rotates. The stomach, originally lying in the midline of the embryo, rotates so that its body is on the left. This rotation also affects the part of the gastrointestinal tube immediately below the stomach, which will go on to become the duodenum. By the end of the fourth week, the developing duodenum begins to spout a small outpouching on its right side, the hepatic diverticulum, which will go on to become the biliary tree. Just below this is a second outpouching, known as the cystic diverticulum, that will eventually develop into the gallbladder.