CS FundamentalsModerateTCS · Accenture · Git interview
A developer edits a tracked file app.py, creates a new file util.py, and runs git commit -a -m "update". What is committed?
- A. Both app.py and util.py
- B. Only util.py
- C. Only the changes to app.py; the new, untracked util.py is not included
- D. Nothing, because -a needs git add first
Correct answer: C. Only the changes to app.py; the new, untracked util.py is not included
-a automatically stages modifications and deletions of tracked files only. Untracked files must be added explicitly with git add.
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
- A CI job runs git clone --depth 1 on a large repository. Which statement is correct?
- Assertion (A): Raising average server CPU utilisation from 50% to 95% to save cost usually makes response times much worse. Reason (R): In…
- In 30 days a service had 4 incidents with total downtime of 6 hours. What are its mean time between failures (uptime-based) and its…
- A team distinguishes elasticity from scalability. Which statement is correct?
- A team considers splitting its monolith into microservices. Which of these is the strongest reason to do it?
- A team's stand-up asks each person what they did yesterday, will do today and what blocks them. During it, two developers start a…