How can you identify who changed the specific file under version control and what were the changes?
Experience Level: Junior
Tags: GitSource control
Answer
You can use two different git commands.
git blame file.txt
- this command will show you the content of the file together with commints and their authors, so you can see who created/changed which line and whengit log file.txt
- this command will show you the list of all commits that contain any change done to the file
Related Git job interview questions
How do you add a new file to the Git remote repository?
Git JuniorWhat is a git commit command?
GitSource control JuniorHow can you find out what were the most recent changes in Git repository and who made them?
GitSource control JuniorHow do you get changes from the remote repository to your computer?
GitSource control JuniorWhat is a difference between local and remote repository?
GitSource control Junior