ETExamTower
Q16Software Development and Design

Drag and drop the Git commands into the correct sequence to create a feature branch from master, then merge that feature branch into master. <DragDrop items={["git branch -d feature","git checkout -b feature master","git checkout master","git push origin master","git merge --no-ff feature"]} slots={[{"answer":"git checkout -b feature master","id":"step1","label":"step 1"},{"answer":"git checkout master","id":"step2","label":"step 2"},{"answer":"git merge --no-ff feature","id":"step3","label":"step 3"},{"answer":"git push origin master","id":"step4","label":"step 4"},{"answer":"git branch -d feature","id":"step5","label":"step 5"}]} explanation={"Create `feature` from `master`, return to `master`, and merge `feature` with `--no-ff` to preserve an explicit merge commit. Push the resulting master branch to `origin`, then safely delete the now-merged local feature branch with `git branch -d`.\n\n**Learn more:** [git-checkout Documentation](https://git-scm.com/docs/git-checkout) · [git-merge Documentation](https://git-scm.com/docs/git-merge)"} reuse={false} />

← → navigate · a answer
Discussion · 10
22
Altough, step 4 and step 5 in practice can be swapped, the expected answer is: step 1. git checkout -b feature master step 2. git checkout master step 3. git merge --no-ff feature step 4. git branch -d feature step 5. git push origin master
20
I concur with FR99 Step 1 --------- > git checkout -b feature master (Create new branch called feature and switch) Step 2 --------- > git checkout master ( switch back to Master branch) Step 3 --------- > git merge –no-ff feature (Merge changes from feature to master branch) Step 4 --------- > git push origin master ( Push changes to remote repo) Step 5 --------- > git branch -d feature (Delete the branch called feature)
6
Swap step 4 and 5
4
Why delete the branch before pushing master, and not after pushing?
3
I really hope this broken question doesn't appear in my exam...
2
In my opinion, deleting a branch is not an important process. So, one of steps 4 and 5 can be done before the other.
2
Hello, have you already taken the exam? Did this question appear?
1
Both models should work, and therefore they both should be counted as such. I would rather delete the branch after the merger, but it should be a personal preference and will have no impact on the end-result.
1
$ git checkout develop Switched to branch 'develop' $ git merge --no-ff myfeature Updating ea1b82a..05e9557 (Summary of changes) $ git branch -d myfeature Deleted branch myfeature (was 05e9557). $ git push origin develop
1
It is generally better to push the changes to the remote repository before deleting the local branch, so that other team members can access the changes if needed from chatgpt