Home Git Quiz : Complete Questions and Answers 2024 ddevelopment Git Quiz : Complete Questions and Answers 2024 byTeckBootcampsMay 16, 20240 minute read Git Quiz : Complete Questions and Answers 0 Shares 0 0 0 0 Git QUIZ 1 / 15 1. You’re working on a feature branch and want to integrate your changes into the main branch without disrupting the main branch’s stability. 1. Directly merge your feature branch into the main branch. 2. Create a pull request on GitHub to merge your feature branch into the main branch. 3. Use git cherry-pick to selectively apply changes from your feature branch to the main branch. 2 / 15 2. You accidentally committed and pushed a change that introduced a critical bug into production. You realize the error right away and need to undo this commit. 1. Use git revert HEAD. 2. Use git reset –hard HEAD^. 3. Use git reflog to find the commit before the bad commit and then use git reset –hard <commit-hash>. 3 / 15 3. You’re collaborating with a team member on a project, and both of you have made changes to the same file. You need to synchronize your changes with your teammate’s. 1. Use git pull to fetch and merge your teammate's changes. 2. Use git fetch followed by git merge to incorporate your teammate's changes. 3. Use git rebase to apply your changes on top of your teammate's changes. 4 / 15 4. You’ve finished working on a feature and want to clean up your workspace by removing untracked files and directories 1. Use git clean -f. 2. Use git clean -fd. 3. Use git clean -fdx. 5 / 15 5. You’ve cloned a repository and want to rename the remote URL to something more meaningful. 1. Use git remote rename origin newname. 2. Use git remote set-url origin newurl. 3. Both A and B are correct. 6 / 15 6. You’re in the middle of working on a task but need to switch to a different branch to check out some urgent fixes. You don’t want to commit your current changes yet. 1. Use git stash save "Temporary changes". 2. Use git stash push -m "Temporary changes". 3. Use git stash -k "Temporary changes" 7 / 15 7. You’ve made several commits and want to revert a specific file to its state in a previous commit. 1. Use git checkout <commit-hash> — path/to/file. 2. Use git restore –source=<commit-hash> path/to/file 3. Use git revert <commit-hash> — path/to/file. 8 / 15 8. You’ve realized that a file was mistakenly added to your repository and you want to completely remove it from the entire history of the project. 1. Use git rm –cached filename. 2. Use git filter-branch –index-filter "git rm –cached –ignore-unmatch filename" –prune-empty –tag-name-filter cat — –all 3. Use git reset –hard HEAD~1. 9 / 15 9. You want to create a new branch starting from a specific commit instead of the latest commit on the current branch. 1. Use git checkout -b new_branch <commit-hash>. 2. Use git branch new_branch <commit-hash>. 3. Use git checkout <commit-hash>; git checkout -b new_branch. 10 / 15 10. You have a patch file generated from another repository and want to apply it to your current repository. 1. Use git apply patchfile.patch. 2. Use git am <patchfile.patch> 3. Use git merge patchfile.patch. 11 / 15 11. You’re interested in identifying the largest file within your repository to manage storage space more effectively. 1. Use git ls-files | xargs du -h | sort -hr | head -n 1 2. Use git rev-list –objects –all | grep -oP '(?<=blob )d+' | xargs -I {} sh -c 'echo {} && git show –pretty=format:%s {}' | sort -nr | head -n 1. 3. Use git rev-list –objects –all | wc -l. 12 / 15 12. You need to refer to a specific commit in your Git repository. 1. Use HEAD~1. 2. Use git rev-parse HEAD. 3. Use git describe –tags 13 / 15 13. You want to automate a task whenever a commit is made in your repository. 1. Write a script in the .git/hooks directory and make it executable. 2. Use git config –global core.autocrlf true. 3. Use git config –global user.name "Your Name". 14 / 15 14. You’re curious about how Git internally manages changes and stores them in the repository. 1. Git stores changes in a binary format in the .git directory. 2. Git uses a combination of text files and binary blobs to store changes. 3. Git stores changes in a database-like structure. 15 / 15 15. You want to automatically trigger a script to run every time someone makes a commit to your repository. 1. Place the script in the .git/hooks directory and make it executable. 2. Configure a cron job to execute the script at specific intervals. 3. Set up a webhook in GitHub to call the script upon receiving a push event. Your score is The average score is 32% LinkedIn 0% Restart quiz Send feedback Author TeckBootcamps View all posts Tags:devops 0 Shares: Share 0 Tweet 0 Share 0 Share 0 TeckBootcamps
Read More 14 minute read kkubernetes The Best Kubernetes Tools for Your Cloud Native JourneybyTeckBootcampsDecember 4, 2024 Table of Contents Show What is Kubernetes ?Why use Kubernetes?Check latest Kubernetes Exam (CKAD , CKA and CKS)…
Read More 3 minute read kkubernetes Real World Example: Configuring Redis with ConfigMapbyTeckBootcampsOctober 13, 2024 Table of Contents Show k8s cluster configurationTargetCreate ResourcesCreate configmapCreate a redis podVerify Redis ConfigurationGet redis configuration informationModify configmapCheck…
Read More 1 minute read kkubernetes [Solved] Troubleshooting Kubernetes Application Istio Service Mesh Upstream Connect ErrorbyTeckBootcampsOctober 13, 2024 Table of Contents Show ProblemSolutionBest PracticesDocumentationAuthor Problem A microservice application running in Kubernetes with Istio service mesh encountered…
Read More 1 minute read QQUIZ Kubernetes Quiz: Questions And Answers 2024byTeckBootcampsOctober 13, 2024 Check our last updated 2024 Kubernetes Exam Guides (CKAD , CKA , CKS) : [ 30% OFF ]…
Read More 0 minute read QQUIZ DevOps Quiz : Questions and Answers 2024byTeckBootcampsOctober 13, 2024 Author TeckBootcamps View all posts
Read More 4 minute read CCertification Guides Prometheus Certified Associate (PCA): Complete Study Guide and Exam PreparationbyTeckBootcampsOctober 13, 2024 Table of Contents Show Prometheus Certified Associate RegistrationPCA Exam DetailsDomains & CompetenciesPCA LabPCA Preparation GuideObservability ConceptsPrometheus FundamentalsPromQLInstrumentation and…