Top 10 Git Interview Question and Answers

 



Question 1: What is Git and GitHub ?

Answer :- Git is a tool that manage source code history and Github is code hosting service.



Question 2:  What is Git Rebase and Merge ?

Answer :- Both use to merge the code and by using the rebase we will get linear history..



Question 3: What is different git fetch and clone ? ?

Answer : Git fetch use to get review the new changes in code and git clone use to get new change and it not give us change to see new chnages in the code, So git close is combination of git fetch and git merge, here we may get conflicts but while using git fetch we can abort the confits..



Question 4: What is stash ?

Answer :- Its like additional space to save the code snapshoot in later we can add in on going code.



Question 5: What is revert and reset ?

Answer :- Git revert use to revert the code with new commit and git reset use to do undo it..



Question 6: How to add, commit and push the file ?

Answer :- git add . to add the file, git commit -m “YOUR_MESSAGE_HERE” to add the commit message, git push command to push the code on git repository.



Question 7: How to change the branch ?

Answer : git checkout branch name



Question 8: What is cherry pick in git ?

Answer : To merge the code from different branches, We need to use cherry-pick.



Question 9: What is different between fork and clone ? 

Answer : In fork we take git repository copy to another git repository and while using git close we take local copy of the git repository code.



Question 10: How to check git source code history ?

Answer : While using git log to see the source code history.


Top 10 Git Interview Question and Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top