Developer's Git | Fresco Play

Developer's Git | Fresco Play

Monday, May 22, 2023
~ 3 min read
Developer's Git | Fresco Play

Question 1: What is the GIT command to blow away all changes since last commit?

Answer: git checkout filename


Question 2: What is the GIT command to skip staging and directly commit the changes directly ?

Answer: git commit -a -m “message


Question 3: What does the command git add. do?

Answer: Adds all the files to staging area


Question 4: GIT takes care of access control.

Answer: False


Question 5: What is the GIT command to see all changes since the last commit ?

Answer: git status


Question 6: It is a good practice to use present tense in commit messages.

Answer: True


Question 7: GIT is a ___

Answer: Distributed Version Control System


Question 8: After performing several commits, or cloning a repository with an existing commit history

Answer: git log


Question 9: What does the following command perform? Git reset –- soft HEAD^

Answer: Move commit to one before current head


Question 10: When I run git fetch from my local repo it will update my local code?

Answer: False


Question 11: What is the git command to directly create and move to a new branch?

Answer: git checkout -b branchname


Question 12: What is the command to delete a branch in GIT?

Answer: git branch -d branchname


Question 13: What is the GIT command to create a branch?

Answer: git branch branchname


Question 14: What does the command git checkout branchname do?

Answer: Switches from main branch to the new branch


Question 15: What is a good practice to follow when you want to back up a local branch?

Answer: Push to remote repo


Question 16: What does the GIT command 'git remote prune origin' do?

Answer: Cleans up all remote stale repos


Question 17: What is the command to delete a remote branch in GIT?

Answer: git push origin : branchname


Question 18: A tag in GIT context is a

Answer: Reference to a specific commit


Question 19: What is the GIT command to see all the remote branches?

Answer: git branch -r


Question 20: If you want to list all the changes and know who made them at what time , what command should you use?

Answer: git blame


Question 21: If you want to see the changes since last commit in a specific file, what command should you use?

Answer: git diff filename


Question 22: What is the output of the following code 'git log –- pretty = oneline'?

Answer: Display one commit per line with SHA in the beginning


Question 23: What is the GIT command to view the log with code level changes?

Answer: git log - - oneline – p


Question 24: It is a good practice to include log files inside a repository.

Answer: False


Question 25: What does the command 'git log - - oneline – graph' do?

Answer: Visual representation of the branch merging into master


Post a comment

Comments

Join the conversation and share your thoughts! Leave the first comment.

Get your FREE PDF on "100 Ways to Try ChatGPT Today"

Generating link, please wait for: 60 seconds

Checkout all hot deals now 🔥

Search blogs

No blog posts found