GIT Interview Question
GIT Interview Question
@Dimple Kumari
What is Git?
@Dimple Kumari
What is the command to write a commit
message in Git?
Use:
git commit -a
-a on the command line instructs git to commit the new content
of all tracked files that have been modified. You can use
git add <file>
or
git add -A
before git commit -a if new files need to be committed for the
first time.
@Dimple Kumari
What is difference between Git vs SVN?
@Dimple Kumari
What's the difference between a pull request
and a branch?
@Dimple Kumari
What is the difference between git pull and git fetch?
In the simplest terms, git pull does a git fetch followed by a git
merge.
When you use pull, Git tries to automatically do your work for
you. It is context sensitive, so Git will merge any pulled commits
into the branch you are currently working in. pull automatically
merges the commits without letting you review them first. If you
don’t closely manage your branches, you may run into frequent
conflicts.
When you fetch, Git gathers any commits from the target branch
that do not exist in your current branch and stores them in your
local repository. However, it does not merge them with your
current branch. This is particularly useful if you need to keep
your repository up to date, but are working on something that
might break if you update your files. To integrate the commits
into your master branch, you use merge.
@Dimple Kumari
How does the Centralized Workflow work?
The Centralized Workflow uses a central repository to serve as the
single point-of-entry for all changes to the project. The default
development branch is called master and all changes are committed
into this branch.
@Dimple Kumari
What is Git fork? What is difference between
fork, branch and clone?
💼 𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 — https://www.linkedin.com/in/dimple-kumari/
🔗 𝐌𝐞𝐝𝐢𝐮𝐦 — https://medium.com/@dimplekumari0228
✍️ 𝐂𝐨𝐝𝐞𝐩𝐞𝐧 — https://codepen.io/DIMPLE2802
@Dimple Kumari