Question: (10 points)

Given the initial and final state of the Git commit history visualized below, you need to deduce the series of Git commands in a specific order that transformed the initial state into the final state.
Screenshot (98)

Figure 1: Initial version history

Initial State (Figure 1):

β€’ There is a single main branch with two commits. The history is linear with commit
C0 followed by commit C. The asterisk (*) indicates the checked out branch that HEAD is currently pointing to. Therefore, it shows your current location.

Screenshot (99)

Figure 2: Goal to reach
Final State (Figure 2):

:black_circle: The main branch has a new commit C3 that follows C1

:black_circle: There is a new branch called bugFix pointing to commit C2’ which is a copy of C2.

:black_circle: The work from bugFix is moved directly onto the work from main. That way it would look like

these two features were developed sequentially, when in reality they were developed in parallel.


What sequence of Git commands were used to go from the initial state to the final state? Please provide the commands in the order they were executed, taking into account the creation of bugFix, the commits, and the the HEAD pointer.

Good luck!


Hey @Prerit_Mishra, this looks like a homework question (and doesn’t involve Streamlit). Closing this thread but let me know if I’ve missed something.