Here you will found a daily challenge questions and responses (next day) as log:
Q : To set your email address at the global (or user) level, what command would you type?
- git set --user email
<email>
- git config --global user.email
<email>
✔️️ - git config email
<email>
- git set --user user.email
<email>
Q : To create a Git repository, which command do you run?
- git create
<project-name>
- git new
- git new
<project-name>
- git init ✔️️ ️
Q : True or False: The git status command shows the status of the integrated repository test suite.
- true
- false ✔️️ ️
Q : Which command would you run to stage the changes in the js/app.js
file?
- git add
js/app.js
✔️️ ️ - git stage
js/app.js
- git commit
js/app.js
- git commit
js/app.js
--to-staging-area
Q : Write the basic command used to create a commit from the staged changes (don't include any flags).
git commit ✔️️ ️
Q : What is the name of the file used to tell Git to ignore certain files?
- gitignore
- .gitignore ✔️️ ️
- ignore.git
- ignore
Q : What command do you run to view the commit history of your repositor?
- git history
- git log ✔️️ ️
- git commit -h
- git past
Q : To create a branch, you run git branch
. How can you create a branch and switch to it in one command?
- git branch --switch
<branch-name>
- git branch --checkout
<branch-name>
- git checkout -b
<branch-name>
✔️️ ️ - git checkout --create-branch
<branch-name>
Q : Write the command that would merge the awesome_feature branch with the master branch, assuming you are on the master branch.
git merge awesome_feature ✔️️ ️
Q : Which command will add a remote branch to the repository?
- git remote add
<name>
<url>
✔️️ ️ - git branch --remote
<name>
<url>
- git remote new
<name>
<url>
- git branch
<name>
<url>
Q : Assuming your repo has a remote called production, what command would send all local committed changes on the master branch to that remote?
- git send master production
- git send production master
- git push master production
- git push production master ✔️
Q : Write the command that would remove the latest stash from the stash list and apply it to the staging area.
git stash pop ✔️
Q : What command would create the c
alias for the commit
command (at the global, or user, level)?
- git config --global alias.c commit ✔️
- git config --global alias.commit c
- git config alias.c commit
- git config alias.commit c
Q : Write the command that will display the diff of the README file, comparing the version in the staging area with the latest committed version.
git diff --staged README ✔️
Q : What is the purpose of git filter-branch
?
- To perform a text search inside a particular set of branches
- To rewrite history by applying some operation to all commits ✔️
- To list all local branches except the ones filtered out by some predicate
- To perform garbage collection on a single branch
Q : Where does Git look for its subprograms (git-commit, git-diff)?
- PATH environment variable
- git.binaries global config
- GIT_EXEC_PATH environment variable ✔️
- the directory where git itself is located
Q : git describe
looks for the nearest ___ reachable from the commit
- remote
- author
- tag ✔️
- branch
Q : What does a " "
sign at the beginning of a refspec mean?
- That there is a one-to-many mapping between refs
- That the remote branch may not exist
- That overwriting (non-fast-forward) updates are allowed ✔️ ️
- That authentication will be required
Q :"Sparse checkout" allows you to
- check out only some files from the repository into your working copy ✔️ ️
- check out a branch from the repository without some of its commits
- init only the main submodule of the repository
- clone a remote such that you get a working copy but no repository (no .git folder)
Q : Git-attributes filters are used for...
- transforming how the repository is presented in
git status
andgit log
- applying text substitutions inside commits received from remotes
- applying text substitutions on commit/checkout ✔️ ️
- ignoring files based on metadata
Q : A bare Git respository...
- has no remotes
- has .git directory in a separate location from its working tree
- has an empty working tree
- has contents of .git directory instead of a working tree ✔️ ️
Q : What does a commit range branch1..branch2
mean?
- All commits that contain files changed between commits at branch1 and branch2
- All commits reachable from branch2, but not reachable from branch1 ✔️ ️
- All commits reachable from branch1, but not reachable from branch2
- All commits created in the period between commits at branch1 and branch2
Q : Git reflog is used to...
- synchronize with remote-tracking branches
- track authors of changes
- store the history of updates of refs ✔️ ️
- store the history of merge conflicts
Q :A Git tree object..
- can contain references to other tree objects or blobs ✔️ ️
- can only contain references to blobs
- can contain file data or references to other tree objects or blobs
- can only contain references to other tree objects
Q : When should you NOT run git gc
?
- In a sparse working tree
- When working in someone else's branch
- When you have orphaned objects you want to restore ✔️ ️
- When you plan to push to a remote
Q : If you're cloning a repository that contains submodules, they will be initialized...
- only after
git submodule init
andgit submodule update
- after
git submodule init
andgit submodule update
or if you clone with--recursive
argument ✔️ ️ - only if you clone with
--recursive
argument - only if you clone with
--submodules
argument
Q :Where is a branch stored inside a Git repository?
- Inside either .git/branches file or .git/packed-refs file
- Inside .git/refs directory
- Inside .git/packed-refs file
- Inside either .git/refs directory or .git/packed-refs file ✔️ ️
Q : What files can be searched in using git grep
?
- Current working tree and remote working tree
- Current working tree
- Any files on the computer
- Any local Git trees ✔️ ️
Q :What can't be cryptographically signed in Git?
- Branches ✔️ ️
- Tags
- Merge commits
- Regular commits
Q : Which of the following is not a valid option for credential.helper
setting?
- cache
- temporary ✔️ ️
- store
- no value (default)