You have a GitHub repository.A file that contains secrets is committed and pushed to the repository accidentally.You need to perform the following actions:-Remove the file from the repository.-Remove all commits that include the file from the repository.The solution must minimize administrative effort.What should you use?
Answer(s): C
To remove a sensitive file and its entire history from a GitHub repository, the most effective and recommended tool is git-filter-repo.The Fastest Solution: git-filter-repoThis tool effectively "rewrites" your project's history as if the file never existed.1. Install the toolpip install git-filter-repo2. Make a fresh cloneWork on a fresh copy to avoid messing up your local work:git clone --mirror https://github.com3. Run the removal commandgit filter-repo --path path/to/secret_file --invert-paths4. Force push to GitHubUpdate the remote server with the "cleaned" history:git push origin --force --all
https://dev.to/chriswinnen/youve-leaked-a-secret-in-your-git-repository-now-what-2od6
You are using GitHub as a source code repository.You create a client-side Git hook on the commit-msg event. The hook requires that each commit message contain a custom work item tag.You need to make a commit that does not have a work item tag.Which git commit parameter should you use.
Answer(s): B
The commit-msg hook is invoked by git-commit and git-merge, and can be bypassed with the --no-verify option.
https://git-scm.com/docs/githooks
DRAG DROP (Drag and Drop is not supported)You have a GitHub repository named repo1.You migrate repo1 to an Azure Repos repository named repo2.After the migration, changes are made to repo1.You need to sync the changes to repo2.How should you complete the script? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.Note: Each correct selection is worth one point.Select and Place:
Answer(s): A
First, clone the Azure Repos repository (repo2). Then, configure the original GitHub repository (repo1) as the upstream remote. Finally, fetch the latest changes and tags from GitHub and push all local branches to Azure Repos.
https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?tabs=visual-studio&view=azure-devops
HOTSPOT (Drag and Drop is not supported)You have a .NET app named App1.You need to upload App1 to GitHub Packages.How should you complete the command? To answer, select the appropriate options in the answer area.Note: Each correct selection is worth one point.Hot Area:
The dotnet nuget push command pushes a package to the server and publishes it. The push command uses server and credential details found in the system's NuGet config file or chain of config files.Box 1: dotnetWe publish the package to GitHub packages. Using “dotnet nuget push“, with the NuGet package location, defaulting the api-key to GITHUB_TOKEN again, and specifying the source “github” (that we just setup in step 3).- name: Publish to GitHub packages run: dotnet nuget push DemoLibrary/DemoLibrary/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"Box 2: nuget push
https://samlearnsazure.blog/2021/07/27/publishing-a-nuget-package-to-github-packages/https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
HOTSPOT (Drag and Drop is not supported)Your company uses GitHub for source control. GitHub repositories store source code and store process documentation. The process documentation is saved as Microsoft Word documents that contain simple flow charts stored as .bmp files.You need to optimize the integration and versioning of the process documentation and the flow charts. The solution must meet the following requirements:-Store documents as plain text.-Minimize the number of files that must be maintained.-Simplify the modification, merging, and reuse of flow charts.-Simplify the modification, merging, and reuse of documents.Hot Area:
Box 1: Markdown (.md)Github understands several text formats, including .txt and .md. .md stands for a file written in Markdown.Box 2: Mermaid diagramsMermaid lets you create diagrams and visualizations using text and code.It is a Javascript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically.
https://ourcodingclub.github.io/tutorials/git/https://mermaid-js.github.io/mermaid/#/
Post your Comments and Discuss Microsoft AZ-400 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the AZ-400 content, but please register or login to continue.