Git

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

What does git reset HEAD do?

Reverts

What does a git commit do?

Saves and stores the changes permanently. This occurs from the staging area inside the repository.

What is Git

A tool to save versions of your code. You can save and undo multiple versions of a project as well as join together with other developers

What are three rules of a git commit syntax?

It must include -m, quotation marks with text written in present tense, and brief.

Explain the brains of Git. How does it process what work you do?

Git tracks and stores the information you make. It holds the changes you make on a project over time.

What does init mean? What does git init do?

Initialize; It tells the directory that this area is now a Git project. The two combined mean Git now has all the tools necessary to track changes made to the project

Why use Git?

It can be extremely helpful to retrieve a version of your work instead of losing it completely.

How can you find the head commit? What is it?

The head commit is found when, after you commit, you type in: git show HEAD. It is the most recently made commit that will be displayed

What is the general purpose of a branch?

To start a new project on the current line of work, but ultimately merge it onto the master branch.

What does git status do? What about red text in it?

Tracks the changes made to the project; red text means Git sees the file, but has not started tracking the changes yet

How do you find out which branch you are on?

Type in git branch

How do you switch branches?

Type in git checkout branch-name

How do you merge branches?

Type in git merge branch-name

How do you add a file that has changed to the staging area?

Use git add filename

To make git start tracking a file, what do you need to do first?

Use git add filename, where filename is the name of the file

How can you remove an added file from the staging area before you commit?

Use git reset filename

To change directories, what command do you use?

cd directory-name

To delete a branch, what command do you use?

git branch -d branchname

How do you add a new branch?

git branch branch-name

If you want to revert changes made from a former commit, what action do you tell Git to do?

git checkout HEAD filename

To make a replica of a repository, what command do you use? What does the second command do? The third?

git clone remote_location clone_name; remote_location can be a web address and a file path. Clone_name is going to be the name you give to the directory in which Git clones the directory.

To find out what's new in the file, what command do you use?

git diff filename, where filename is the name of the file you have changed.

To get updated information from the directory, what command can be used?

git fetch

What is the prerequisite to start a git project? Explain the three parts of a Git project workflow.

git init; Working Directory - This is the factory where all the work takes place. Creating, editing, deleting, and organizing files all take place here. Staging Area - This is like a note taking area where you list changes you made to the working directory. Repository - The eternal room of Git. It is where Git permanently stores changes as a different version of a project.

To refer to an earlier version of the project, what do you use?

git log

To obtain a list of remotes, what command do you use?

git remote -v


संबंधित स्टडी सेट्स

Chem I Final Exam Comprehensive Review

View Set

IT Security: Defense Against the Digital Dark Arts

View Set

Tetracyclines, Macrolies, & Other Protein Synthesis Inhibitors

View Set

Mastering A&P Chapter 22 questions

View Set