0% found this document useful (0 votes)
78 views3 pages

Git Interview Qns

This document discusses various concepts and commands related to version control systems (VCS) like Git and SVN. It compares features of Git and SVN, discusses advantages of Git over SVN, explains key Git concepts like staging, commits, pushes, pulls, branching, merging, conflicts and how to resolve them. It also covers various Git commands and workflows like cloning repositories, ignoring files, adding/deleting files, comparing differences, restoring deleted files, listing changes between branches and more.

Uploaded by

deepu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views3 pages

Git Interview Qns

This document discusses various concepts and commands related to version control systems (VCS) like Git and SVN. It compares features of Git and SVN, discusses advantages of Git over SVN, explains key Git concepts like staging, commits, pushes, pulls, branching, merging, conflicts and how to resolve them. It also covers various Git commands and workflows like cloning repositories, ignoring files, adding/deleting files, comparing differences, restoring deleted files, listing changes between branches and more.

Uploaded by

deepu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.* What is Version Control System?

2.* Why we need any Version Control System (v.C.S)

3.* What is the difference between SVN and Git?

4.* Which VCS you prefer? SVN Or Git? Why?

5.* What are the advantages of Git over SVN?

6. Why we call Git as Distributed VCS?

7. Can you explain Git's End-to-End work flow?

8. How do you clone the code using git?

9.* What is the difference between Commit & Push?

10.* What is the difference bet'n Push and Pull?

11. Can you explain Git architecture?

12.* What is the diff. bet'n Centralized and Distributed VCS.

13. Have you ever created Remote repositories in Git? How?

14. What happens if I delete .git folder?

15. How do you configure username, email and editor first time
in Git?

16. Where Git stores configuration details?

17.* What is the advantage of STAGE in Git?

18. Git log options related questions


--author
--grep
--oneline
--since/until
-n2

19. What is SHA-1? How Git uses this?

20.* I have a file modified in my Working directory. How do you


show the content diff?

21.* How do you show the content diff of a file which is staged?

22. How do you delete and rename a file in Git?

23.** What is your branching stratogy?


Can you explain your release process/Stratogy?

24.** What branching model you suggest for parellel development?

25. Developer fixes a bug. How do you take the change to


production?
25.** Explain defferent branching models that you have worked-on.

26. Did you work on merging the code in Git?

27.* How do you merge the code in Git?

28.* What is merge? What is conflict?

29. When do we get conflict?

30.* What is fast-forward merge in Git?

31.* What is the difference between Merge and Rebase?

32.* How do you resolve the conflit in Git?

34.* What kind of conflicts you have seen?

35. Who resolves the conflicts?

36.** What is the difference between branch and tag?


When do you create a branch and tag?

37. How do you create a branch and switch to that using single
command?

38. What is HEAD pointer in Git? Where Git store HEAD info.

39. Can we store binary files in Git?

40. Can skip the staging? How? what are the caveats?

41.* How do you list files/folders modified as part of a commit?

42.* How do you ignore: ex:


all files ending with .class
all files having alphanumeric
all log files but not build.log

43. How do you add ignore list for all users?

44.* What are the different files you ignore in your project?

45. How to remove a committed change? Or can we remove?


$ git reset --hard HEAD~1
$ git reset --soft HEAD~1
46. How do you lock the branch

47. How do you clone the code from a particular SHA?

48. How do you restore a deleted file? Or previous changes of


a file?

49. How do you list the diff. of a file between two different
branches.
$ git diff dev_1.2.4...master -- LoginUser.java

50. How do you list the changes which are going to be fetched?
$ git log origin/master ^master
51. What is Git Stash?

52. How do you add a new remote to git? Or How do you attach
your local repo with remote?

53. What is git ls-tree?


git ls-tree <sha> --> Lists files committed as part of
a commit.

Qns-
1. How do you clone the code at a SHA / Snapshot?
2. How do you clone a particular module or folder?
3. how do revert a change or bring a file back?

You might also like