Skip to content

developer-circle-marrakech/30-days-git-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 

Repository files navigation

30-days-git-challenge

Here you will found a daily challenge questions and responses (next day) as log:

Day 01 :

Q : To set your email address at the global (or user) level, what command would you type?

  1. git set --user email <email>
  2. git config --global user.email <email> ✔️️
  3. git config email <email>
  4. git set --user user.email <email>

Day 02 :

Q : To create a Git repository, which command do you run?

  1. git create <project-name>
  2. git new
  3. git new <project-name>
  4. git init ✔️️ ️

Day 03 :

Q : True or False: The git status command shows the status of the integrated repository test suite.

  1. true
  2. false ✔️️ ️

Day 04 :

Q : Which command would you run to stage the changes in the js/app.js file?

  1. git add js/app.js ✔️️ ️
  2. git stage js/app.js
  3. git commit js/app.js
  4. git commit js/app.js --to-staging-area

Day 05 :

Q : Write the basic command used to create a commit from the staged changes (don't include any flags).

git commit ✔️️ ️


Day 06 :

Q : What is the name of the file used to tell Git to ignore certain files?

  1. gitignore
  2. .gitignore ✔️️ ️
  3. ignore.git
  4. ignore

Day 07 :

Q : What command do you run to view the commit history of your repositor?

  1. git history
  2. git log ✔️️ ️
  3. git commit -h
  4. git past

Day 08 :

Q : To create a branch, you run git branch . How can you create a branch and switch to it in one command?

  1. git branch --switch <branch-name>
  2. git branch --checkout <branch-name>
  3. git checkout -b <branch-name> ✔️️ ️
  4. git checkout --create-branch <branch-name>

Day 09 :

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 ✔️️ ️


Day 10 :

Q : Which command will add a remote branch to the repository?

  1. git remote add <name> <url>✔️️ ️
  2. git branch --remote <name> <url>
  3. git remote new <name> <url>
  4. git branch <name> <url>

Day 11 :

Q : Assuming your repo has a remote called production, what command would send all local committed changes on the master branch to that remote?

  1. git send master production
  2. git send production master
  3. git push master production
  4. git push production master ✔️

Day 12 :

Q : Write the command that would remove the latest stash from the stash list and apply it to the staging area.

git stash pop ✔️


Day 13 :

Q : What command would create the c alias for the commit command (at the global, or user, level)?

  1. git config --global alias.c commit ✔️
  2. git config --global alias.commit c
  3. git config alias.c commit
  4. git config alias.commit c

Day 14 :

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 ✔️


Day 15 :

Q : What is the purpose of git filter-branch?

  1. To perform a text search inside a particular set of branches
  2. To rewrite history by applying some operation to all commits ✔️
  3. To list all local branches except the ones filtered out by some predicate
  4. To perform garbage collection on a single branch

Day 16 :

Q : Where does Git look for its subprograms (git-commit, git-diff)?

  1. PATH environment variable
  2. git.binaries global config
  3. GIT_EXEC_PATH environment variable ✔️
  4. the directory where git itself is located

Day 17 :

Q : git describe looks for the nearest ___ reachable from the commit

  1. remote
  2. author
  3. tag ✔️
  4. branch

Day 18 :

Q : What does a " " sign at the beginning of a refspec mean?

  1. That there is a one-to-many mapping between refs
  2. That the remote branch may not exist
  3. That overwriting (non-fast-forward) updates are allowed ✔️ ️
  4. That authentication will be required

Day 19 :

Q :"Sparse checkout" allows you to

  1. check out only some files from the repository into your working copy ✔️ ️
  2. check out a branch from the repository without some of its commits
  3. init only the main submodule of the repository
  4. clone a remote such that you get a working copy but no repository (no .git folder)

Day 20 :

Q : Git-attributes filters are used for...

  1. transforming how the repository is presented in git status and git log
  2. applying text substitutions inside commits received from remotes
  3. applying text substitutions on commit/checkout ✔️ ️
  4. ignoring files based on metadata

Day 21 :

Q : A bare Git respository...

  1. has no remotes
  2. has .git directory in a separate location from its working tree
  3. has an empty working tree
  4. has contents of .git directory instead of a working tree ✔️ ️

Day 22 :

Q : What does a commit range branch1..branch2 mean?

  1. All commits that contain files changed between commits at branch1 and branch2
  2. All commits reachable from branch2, but not reachable from branch1 ✔️ ️
  3. All commits reachable from branch1, but not reachable from branch2
  4. All commits created in the period between commits at branch1 and branch2

Day 23 :

Q : Git reflog is used to...

  1. synchronize with remote-tracking branches
  2. track authors of changes
  3. store the history of updates of refs ✔️ ️
  4. store the history of merge conflicts

Day 24 :

Q :A Git tree object..

  1. can contain references to other tree objects or blobs ✔️ ️
  2. can only contain references to blobs
  3. can contain file data or references to other tree objects or blobs
  4. can only contain references to other tree objects

Day 25 :

Q : When should you NOT run git gc?

  1. In a sparse working tree
  2. When working in someone else's branch
  3. When you have orphaned objects you want to restore ✔️ ️
  4. When you plan to push to a remote

Day 26 :

Q : If you're cloning a repository that contains submodules, they will be initialized...

  1. only after git submodule init and git submodule update
  2. after git submodule init and git submodule updateor if you clone with --recursive argument ✔️ ️
  3. only if you clone with --recursive argument
  4. only if you clone with --submodules argument

Day 27 :

Q :Where is a branch stored inside a Git repository?

  1. Inside either .git/branches file or .git/packed-refs file
  2. Inside .git/refs directory
  3. Inside .git/packed-refs file
  4. Inside either .git/refs directory or .git/packed-refs file ✔️ ️

Day 28 :

Q : What files can be searched in using git grep?

  1. Current working tree and remote working tree
  2. Current working tree
  3. Any files on the computer
  4. Any local Git trees ✔️ ️

Day 29 :

Q :What can't be cryptographically signed in Git?

  1. Branches ✔️ ️
  2. Tags
  3. Merge commits
  4. Regular commits

Day 30 :

Q : Which of the following is not a valid option for credential.helper setting?

  1. cache
  2. temporary ✔️ ️
  3. store
  4. no value (default)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published