Git

What does git clone do?

What does git clone do? a) Copies a remote Git repository to your local machine b) Deletes a remote repository c) Merges a remote repository into the current branch d) Pushes changes to the remote repository Answer: a) Copies a remote Git repository to your local machine Explanation: The git clone command creates a copy

What does git clone do? Read More »

How do you fetch all remote branches without merging them into your local branches?

How do you fetch all remote branches without merging them into your local branches? a) git fetch b) git pull –no-merge c) git fetch –merge d) git clone –all Answer: a) git fetch Explanation: The git fetch command retrieves all remote branches, tags, and commits without merging them into your local branches. It updates your

How do you fetch all remote branches without merging them into your local branches? Read More »

What does the git gc command do?

What does the git gc command do? a) Optimizes the Git repository by cleaning up unnecessary files and compressing objects b) Generates a commit graph c) Commits all changes automatically d) Deletes all untracked files Answer: a) Optimizes the Git repository by cleaning up unnecessary files and compressing objects Explanation: The git gc command performs

What does the git gc command do? Read More »

What does the git config --list command show?

What does the git config –list command show? a) Displays all configuration settings b) Shows the commit history c) Lists all local branches d) Displays the differences between commits Answer: a) Displays all configuration settings Explanation: The git config –list command displays all Git configuration settings for the repository, including user information, aliases, remote repository

What does the git config --list command show? Read More »

What does git push --force do?

What does git push –force do? a) Forces the remote repository to accept changes, overwriting conflicts b) Deletes the remote branch c) Merges a remote branch with the local branch d) Pushes tags to the remote repository Answer: a) Forces the remote repository to accept changes, overwriting conflicts Explanation: The git push –force command forces

What does git push --force do? Read More »

How do you create an alias for a Git command?

How do you create an alias for a Git command? a) git config –global alias.alias-name 'git-command' b) git alias create alias-name c) git alias git-command alias-name d) git create alias alias-name Answer: a) git config –global alias.alias-name 'git-command' Explanation: The git config –global alias.alias-name 'git-command' command creates an alias for a Git command, allowing you

How do you create an alias for a Git command? Read More »

Scroll to Top