0% found this document useful (0 votes)
49 views3 pages

Git Practice Questions

Git is a free and open-source version control system used to track files and maintain multiple versions. Key commands include 'git add' to track files, 'git commit' to save changes, and 'git push' to share files with central repositories. Additional functionalities include merging branches, pulling updates, and cherry-picking specific commits.

Uploaded by

Manu Manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views3 pages

Git Practice Questions

Git is a free and open-source version control system used to track files and maintain multiple versions. Key commands include 'git add' to track files, 'git commit' to save changes, and 'git push' to share files with central repositories. Additional functionalities include merging branches, pulling updates, and cherry-picking specific commits.

Uploaded by

Manu Manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

GIT ANSWERS

1. What is Git?
Git is nothing but Global Information Tracker.
Git is also called as version control system and source code management.
It is used to track the files.
It will maintain the multiple versions of the same file.
Git is free and open source.

2. How to track a file in git?

Command: git add filename

3. How to commit the file?

To commit a file we use a command called “git commit -m “message” file_name.

4. What is git status?

Git status is used to know the tracking and untacking files in our system.

5. What is git logs?

Git log is a history, we can see the list of every commit in our project along some other
information like who commit the file and when we commit the file.

6. How to configure in git

Git config user.name “name”


Git confit user.email “[email protected]

7. What is git merge?

It allows us to get the code from one branch to another. This is useful when developers
work on the same code and want to integrate their changes before pushing them up in a
branch.
Command: git merge branch_name
8. What is git push?

Git push is used to share the local files into central repositories like GitHub and
Bitbucket.
Command: git push origin branch_name

9. What is Git checkout?

Git checkout is used to switch the branches


Command: git checkout branch_name

10. What is git pull?

Git pull is the combination of git fetch and git merge


Git pull is used to get the commits from central repo to local repo
Command: git pull origin branch

11. What is cherry-pick?

Cherry-pick is used to get a particular file from another branch


command: git cherry-pick commit_id

12. What is git branch?

A branch is a way to isolate development work on a particular aspect of a project.


Command: git branch branch_name

13. What is git blame?

It is used to see the history of the GitHub file.

14. command to see which repo is connected to local

command: git remote -v

15. command to delete the branch from github


command: git push origin --delete branch_name

You might also like