CS FundamentalsHardProduct-company placement · Git
A developer on Windows opens a repository created on Linux, edits one line of a file, and git diff shows every line changed. What is the most likely cause and fix?
- A. The file's encoding was changed by the editor; re-save the file as UTF-16
- B. Git's rename detection failed on Windows; record the change with git mv
- C. LF line endings became CRLF; normalise them via .gitattributes (* text=auto)
- D. Trailing whitespace on each line was trimmed; review the change with git blame -w
Correct answer: C. LF line endings became CRLF; normalise them via .gitattributes (* text=auto)
A line-ending conversion rewrites every line. Declaring text files in .gitattributes (or setting core.autocrlf) makes Git store LF in the repository and convert only in the working tree, so diffs show real changes.
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 product manager ranks 8 candidate requirements with the Analytic Hierarchy Process, comparing every pair once. How many pairwise…
- A team can (A) build a module in-house: 60% chance of gaining ₹50 lakh and 40% chance of losing ₹20 lakh; (B) buy a licence for a certain…
- Usability studies model the share of problems found by n test users as 1 − (1 − L)ⁿ, where L is the probability that one user reveals a…
- Which feature characterises the RAD (Rapid Application Development) model?
- The suite { classify([]), classify([1, -2]) } runs against the function below. Treating each if, the for loop (enter / skip-or-exit) and…
- A program classifies three side lengths as equilateral, isosceles, scalene or 'not a triangle' (when the two shorter sides sum to no more…