Top 50 BitBucket Interview Questions with Answers

BitBucket Interview Questions with Answers

1. What is Bitbucket?

a) A code hosting platform for version control and collaboration
b) A cloud-based storage platform
c) A project management tool
d) An online marketplace for software tools

Answer: a) A code hosting platform for version control and collaboration

2. What is a repository?

a) A collection of code files
b) A folder on your computer
c) A folder on the server
d) A collection of projects

Answer: a) A collection of code files

3. What is the command to create a new repository in Bitbucket?

a) git commit
b) git push
c) git pull
d) git init

Answer: d) git init

4. What is a pull request?

a) A request to merge changes from a branch into another branch
b) A request to delete a branch
c) A request to rename a branch
d) A request to create a new branch

Answer: a) A request to merge changes from a branch into another branch

5. What is a fork?

a) A copy of a repository in your own account
b) A feature in Bitbucket to split a repository into smaller pieces
c) A way to delete a repository
d) A way to rename a repository

Answer: a) A copy of a repository in your own account

6. Which of the following is not a Bitbucket plan option?

a) Small business
b) Enterprise
c) Professional
d) Free

Answer: c) Professional

7. What is the difference between git pull and git fetch?

a) They are the same command
b) git fetch only downloads objects and refs, git pull also merges them
c) git pull only downloads objects and refs, git fetch also merges them
d) git fetch is used to fetch remote branches, git pull is used to fetch local branches

Answer: b) git fetch only downloads objects and refs, git pull also merges them

8. Can you install plugins in Bitbucket Cloud?

a) Yes
b) No

Answer: b) No

9. What is a Bitbucket pipeline?

a) A way to automatically build, test and deploy code changes
b) A way to track issues and bugs in your projects
c) A way to manage user access to your repositories
d) A way to create new branches in your repositories

Answer: a) A way to automatically build, test and deploy code changes

10. What is the purpose of a .gitignore file?

a) To list the files you want to include in your repository
b) To list the files you want to exclude from your repository
c) To list the files you want to delete from your repository
d) To list the files you want to rename in your repository

Answer: b) To list the files you want to exclude from your repository

11. What is the difference between git push and git commit?

a) They are the same command
b) git push uploads changes to the remote repository, git commit only saves the changes to your local repository
c) git push only saves changes to the remote repository, git commit also uploads them
d) git push is used to add, commit and push changes to your local repository, git commit is used to upload changes to the remote repository

Answer: b) git push uploads changes to the remote repository, git commit only saves the changes to your local repository

12. What is a branch?

a) A copy of a repository in your own account
b) A collection of code files
c) A separate timeline of commits from the main branch
d) A way to delete your repository

Answer: c) A separate timeline of commits from the main branch

13. What is a merge conflict?

a) When two branches have different changes to the same line(s) of code
b) When two branches have the same changes to the same line(s) of code
c) When two branches have different file names
d) When two branches have the same file names

Answer: a) When two branches have different changes to the same line(s) of code

14. What is the command to delete a branch in Bitbucket?

a) git branch
b) git remove
c) git pull
d) git branch -d

Answer: d) git branch -d

15. What is the difference between a public and private repository in Bitbucket?

a) Anyone can view and access a public repository, only authorized users can access a private repository
b) Only authorized users can view and access a public repository, anyone can access a private repository
c) A public repository can be owned by anyone, a private repository can only be owned by organizations
d) A public repository has no security restrictions, a private repository requires a login to view/access

Answer: a) Anyone can view and access a public repository, only authorized users can access a private repository

16. What is the command to create a new branch in Git?

a) git commit
b) git push
c) git pull
d) git branch

Answer: d) git branch

17. What is the command to add changes to the staging area in Git?

a) git commit
b) git add
c) git push
d) git pull

Answer: b) git add

18. What is the command to view the changes made in a branch in Git?

a) git status
b) git view
c) git diff
d) git log

Answer: c) git diff

19. What is the command to switch between branches in Git?

a) git checkout
b) git pull
c) git push
d) git stash

Answer: a) git checkout

20. What is a tag in Git?

a) A way to create a checkpoint in your Git history
b) A way to merge two branches
c) A way to delete a branch
d) A way to rename a repository

Answer: a) A way to create a checkpoint in your Git history

21. What is the format of a tag in Git?

a) Tag message
b) Tag name
c) Commit hash
d) Branch name

Answer: b) Tag name

22. What is a head in Git?

a) The tip of a branch in a repository
b) The start of a branch in a repository
c) The middle of a branch in a repository
d) The end of a repository

Answer: a) The tip of a branch in a repository

23. What is a subrepo in Bitbucket?

a) A repository within a repository
b) A folder within a repository
c) A branch within a repository
d) A commit within a repository

Answer: a) A repository within a repository

24. What is the purpose of a README.md file in a repository?

a) To provide documentation and instructions for the repository
b) To list the files you want to exclude from your repository
c) To list the files you want to delete from your repository
d) To list the files you want to rename in your repository

Answer: a) To provide documentation and instructions for the repository

25. What is the command to undo a commit in Git?

a) git commit –amend
b) git reset
c) git revert
d) git stash

Answer: b) git reset

26. What is the command to merge two branches in Git?

a) git commit
b) git push
c) git merge
d) git fetch

Answer: c) git merge

27. What is the difference between a pull request and a merge in Bitbucket?

a) They are the same thing
b) A pull request is a request to merge changes, a merge is the action of actually making the changes
c) A merge is a request to merge changes, a pull request is the action of actually making the changes
d) A pull request is used to add, commit and push changes, a merge is used to merge changes into the main branch

Answer: b) A pull request is a request to merge changes, a merge is the action of actually making the changes

28. What is the command to view the Git history of a repository?

a) git log
b) git status
c) git diff
d) git branch

Answer: a) git log

29. What is the difference between a clone and a fork in Bitbucket?

a) They are the same thing
b) A clone is a copy of a repository on your computer, a fork is a copy of a repository in your own account
c) A fork is a copy of a repository on your computer, a clone is a copy of a repository in your own account
d) A clone is a copy of a repository in your own account, a fork is a way to delete a repository

Answer: b) A clone is a copy of a repository on your computer, a fork is a copy of a repository in your own account

30. What is the command to delete a tag in Git?

a) git tag -d tagname
b) git tag -a tagname
c) git tag -l
d) git tag -v

Answer: a) git tag -d tagname

31. What is the command to cherry-pick a commit in Git?

a) git cherry-pick commit
b) git close commit
c) git squash commit
d) git merge commit

Answer: a) git cherry-pick commit

32. What is the command to undo a merge in Git?

a) git merge –abort
b) git reset
c) git tag -d
d) git clone

Answer: a) git merge –abort

33. What is the command to move a commit to another branch in Git?

a) git move
b) git reset –mixed
c) git tag -m
d) git cherry-pick

Answer: d) git cherry-pick

34. What is a stash in Git?

a) A way to save changes without committing them
b) A way to delete a repository
c) A way to merge two branches
d) A way to rename a repository

Answer: a) A way to save changes without committing them

35. What is the command to apply changes from a stash in Git?

a) git stash apply
b) git stash pop
c) git stash drop
d) git stash save

Answer: b) git stash pop

36. What is the command to rename a branch in Git?

a) git rename
b) git branch -m
c) git push
d) git fetch

Answer: b) git branch -m

37. What is the command to show the difference between two branches in Git?

a) git diff branch1..branch2
b) git merge branch1..branch2
c) git branch -a
d) git tag -l

Answer: a) git diff branch1..branch2

38. What is the command to show the latest commit in Git?

a) git latest
b) git last-commit
c) git show
d) git log -1

Answer: d) git log -1

39. What is the command to change the commit message in Git?

a) git commit –amend
b) git reset
c) git revert
d) git stash

Answer: a) git commit –amend

40. What is the command to see the changes made in a commit in Git?

a) git log
b) git diff
c) git status
d) git view

Answer: b) git diff

41. What is the command to update a forked repository in Git?

a) git push
b) git merge
c) git fetch
d) git pull-request

Answer: c) git fetch

42. What is the purpose of branching in Git?

a) To separate work on a feature or bug fix from the main codebase
b) To delete code files from the repository
c) To merge multiple repositories into one
d) To rename a repository

Answer: a) To separate work on a feature or bug fix from the main codebase

43. What is the purpose of rebasing in Git?

a) To combine changes from one branch into another branch
b) To delete branches from the repository
c) To save changes without committing them
d) To rename a branch

Answer: a) To combine changes from one branch into another branch

44. What is the command to undo changes from a commit in Git?

a) git reset
b) git revert
c) git cherry-pick
d) git stash

Answer: b) git revert

45. What is a remote repository in Git?

a) A repository on your computer
b) A repository in your own account
c) A repository on a remote server
d) A folder on a server

Answer: c) A repository on a remote server

46. What is the difference between Git and Bitbucket?

a) They are the same thing
b) Git is a version control system, Bitbucket is a code hosting platform
c) Bitbucket is a version control system, Git is a code hosting platform
d) Git is a cloud-based storage platform, Bitbucket is a project management tool

Answer: b) Git is a version control system, Bitbucket is a code hosting platform

47. What is the command to create an empty Git repository?

a) git init
b) git clone
c) git push
d) git pull

Answer: a) git init

48. What is the difference between Git and Github?

a) They are the same thing
b) Git is a version control system, Github is a code hosting platform
c) Github is a version control system, Git is a code hosting platform
d) Git is a cloud-based storage platform, Github is a project management tool

Answer: b) Git is a version control system, Github is a code hosting platform

49. What is the command to push changes to a branch in Git?

a) git commit
b) git push
c) git pull
d) git fetch

Answer: b) git push

50. What is a Git hook?

a) A way to run custom scripts in response to Git events
b) A way to delete a repository
c) A way to merge two branches
d) A way to rename a repository

Answer: a) A way to run custom scripts in response to Git events

Ashwani Kumar
Latest posts by Ashwani Kumar (see all)
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x