CS FundamentalsHardAccenture · Git interview
Branches deleted on the remote still appear in git branch -r on a developer's machine. Which command removes these stale remote-tracking branches?
- A. git branch -D origin/*
- B. git fetch --prune
- C. git reset --hard origin
- D. git clean -fd
Correct answer: B. git fetch --prune
Remote-tracking refs are only updated by fetch; --prune also deletes the ones whose remote branch no longer exists. Local branches are unaffected.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- On a cumulative flow diagram for a Kanban board, the band for 'In Review' keeps getting wider over several weeks while the 'Done' line…
- A customer requests a feature on 1 March; the team starts work on it on 10 March and delivers it on 15 March. Using common Kanban…
- According to the 2020 Scrum Guide, how many of these are true? 1. An Increment may be delivered to stakeholders before the end of the…
- A fragment contains total = 0 immediately followed by total = compute(), with no use of total in between, and later print(rate) where rate…
- In domain testing for integer inputs, a program accepts points satisfying x + y ≤ 10 (a closed boundary). Which pair of test points is the…
- A task has optimistic 4 days, most likely 6 days and pessimistic 20 days. What are the triangular-distribution mean (a + m + b)/3 and the…