Git/Github

Ace your homework & exams now with Quizwiz!

What is "Staging Area" or "Index" in GIT?

Before completing the commits, it can be formatted and reviewed in an intermediate area known as 'Staging Area' or 'Index'.

How can we create a gist?

Creating a gist requires a very simple process as depicted in the steps below: - 1. Sign in to GitHub. 2. Navigate to the gist home page. 3. Add a name for the gist. 4. Key in the text of your gist into the gist text box. 5. Select either to create a public gist or to create a secret gist.

What is GIT?

GIT is a distributed version control system and source code management (SCM) system with an emphasis to handle small and large projects with speed and efficiency.

What is a gist in Git?

Gists are a great way to share the work of any developer. They can share parts of files, full applications or single files. Anyone can access gists at https://gist.github.com. Each Gist is a Git repository, which means, it can be forked, and cloned.

Name any two Git repository hosting services which are common

Git Enterprise, bitbucket, github,

How will you know in GIT if a branch has been already merged into master?

Git branch—merged lists the branches that have been merged into the current branch Git branch—-no merged lists the branches that have not been merged

What does 'hooks' consist of in git?

Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. Git hooks are a built-in feature - no need to download anything. Git hooks are run locally.

How will you differentiate between Git and GitHub?

Git is a high-quality version control system. It is distributed in nature and is employed to track changes in source code throughout software development. It has a unique branching model that helps in synchronizing work among developers and tracking changes in any files. GitHub is a cloud-based Git repository hosting service that brings teams together. It gives you a web-based GUI as well as provides access control and many collaboration features, fundamental task management tools for each project.

What language is considered in Git and what is the benefit

Git is purely based on the C and the same make sure of imposing a limit on the overhead of runtimes which are generally associated with other platforms in its class. Also, c makes it compatible with all the other domains and developer's already existing work.

What is the difference between the 'git diff 'and 'git status'?

Git status command will only let you know, what is in the staging area, it will show you whether there is some file which is untracked etc. But it will not show you the exact difference between previous state of a file and current state, if you modified a file like git diff would

How can you create a repository in Git?

In Git, to create a repository, create a directory for the project if it does not exist, and then run command "git init". By running this command .git directory will be created in the project directory, the directory does not need to be empty.

SubGit

It is a software tool to migrate from SVN to Git

Are you familiar with the Git Clone?

It is basically a command which is deployed when it comes to copying a Git repository that already exists. There are a lot of programmers who make use of this. The best thing is it really doesn't matter whether the project is large or small, the same can easily be considered whenever the need of same is felt.

To delete a branch what is the command that is used?

Once your development branch is merged into the main branch, you don't need development branch. To delete a branch use, the command "git branch -d [head]".

Name a few Git repository hosting services

Pikacode Visual Studio Online GitHub GitEnterprise SourceForge.net

git stash pop

Popping your stash removes the changes from your stash and reapplies the last saved state

Mention some of the best graphical GIT client for LINUX?

Some of the best GIT client for LINUX is a) Git Cola b) Git-g c) Smart git d) Giggle e) Git GUI f) qGit

What is the function of 'git config'?

The 'git config' command is a convenient way to set configuration options for your Git installation. Behavior of a repository, user info, preferences etc. can be defined through this command.

What is the difference between git checkout [branch name] and git checkout -b [branch name]

The command git checkout [branch name] will switch from one branch to another. The command git checkout -b [branch name] will create a new branch and also switch to it.

What is the common branching pattern in GIT?

The common way of branching in GIT is to maintain one as "Main" branch and create another branch to implement new features. This pattern is particularly useful when there are multiple developers working on a single project.

What is the function of git clone?

The git clone command creates a copy of an existing Git repository. To get the copy of a central repository, 'cloning' is the most common way used by programmers.

What is the purpose of branching in GIT?

The purpose of branching in GIT is that you can create your own branch and jump between those branches. It will allow you to go to your previous work keeping your recent work intact.

What is the syntax for "Rebasing" in Git?

The syntax used for rebase is "git rebase [new-commit] "

Why is it advisable to create an additional commit rather than amending an existing commit?

There are couple of reason a) The amend operation will destroy the state that was previously saved in a commit. If it's just the commit message being changed then that's not an issue. But if the contents are being amended then chances of eliminating something important remains more. b) Abusing "git commit- amend" can cause a small commit to grow and acquire unrelated changes.

What is a Release branch

They are used for the preparation of new production release. The release branch lets you do minor bug fixes and prepare metadata for release. They may branch off from development and must be merged back into master and develop.

What is hotfix branches

They are used for unplanned production release when there is a need to fix any critical bug immediately in the live prod version. They may branch off from master and must be merged back into develop and master.

What is a Feature branches/Topic Branches

They are used to develop new features for upcoming releases. It may branch off from the develop branch and must be merged back into the develop branch. Generally, these branches exist only in developer repositories, and not in origin.

How can you bring a new feature in the main branch?

To bring a new feature in the main branch, you can use the commands "git merge" or "git pull".

How can you fix a broken commit?

To fix any broken commit, you will use the command "git commit—amend". By running this command, you can fix the broken commit message in the editor.

What is the function of 'git rm'?

To remove the file from the staging area and also off your disk 'git rm' is used.

How can a conflict in git be resolved?

To resolve the conflict in git, edit the files to fix the conflicting changes and then add the resolved files by running "git add" after that to commit the repaired merge, run "git commit". Git remembers that you are in the middle of a merger, so it sets the parents of the commit correctly.

Can you recover a deleted branch in Git?

Yes, you can. To recover a deleted branch, you should know the SHA off the top of your head. SHA or hash is a unique ID that Git creates with every operation. When you delete a branch, you get the SHA displayed on the terminal: Deleted branch <your-branch-name> (was <sha>) You can use the below command to recover the deleted branch: git checkout -b <your-branch-name> <sha> If you don't know the SHA for the commit at the tip of your branch then you can first use the git reflog command to know the SHA value and then apply the above checkout command to restore your branch.

What does commit object contain?

a) A set of files, representing the state of a project at a given point of time b) Reference to parent commit objects c) An SHAI name, a 40 character string that uniquely identifies the commit object

What is Gitlog?

displays committed snapshots. It lets you list the project history, filter it, and search for specific changes.

What is 'git add' is used for?

git add' adds file changes in your existing directory to your index also known as staging area

What is the command that allows to you overwrite local with git pull

git force pull

What is the difference between 'git remote' and 'git clone'?

git remote adds a reference to a remote repository for further tracking, while git clone , well, clones locally a remote repository.

What is the function of 'git checkout' in git?

switches branches or restores working tree files. It operates on files, commits, and branches.

What is GIT stash?

temporarily shelves or stashes changes made to your working copy so you can work on something else, and come back and re-apply them later on

What is GIT stash drop?

the git 'stash drop' command will remove the last added stash item by default, and it can also remove a specific item if you include as an argument.

What is another option for merging in git?

"Rebasing" is an alternative to merging in git. rebasing is changing the base of your branch from one commit to another making it appear as if you'd created your branch from a different commit.

How git instaweb is used?

'Git Instaweb' automatically directs a web browser and runs a webserver with an interface into your local repository.

What is the function of 'GIT PUSH' in GIT?

'command allows you to send (or push) the commits from your local branch in your local Git repository to the remote repository.

What is git Is-tree?

'git Is-tree' represents a tree object including the mode and the name of each item and the SHA-1 value of the blob or the tree. OR Lists the contents of a given tree object, like what "/bin/ls -a" does in the current working directory.

What is the function of 'git diff ' in git?

'git diff ' shows the changes between commits, working tree etc.

What is a SHAI name?

40 character string that uniquely identifies the commit object

What is a 'conflict' in git?

A 'conflict' arises when the commit that has to be merged has some change in one place, and the current commit also has a change at the same place. Git will not be able to predict which change should take precedence.

What is 'head' in git and how many heads can be created in a repository?

A 'head' is simply a reference to a commit object. In every repository, there is a default head referred as "Master". A repository can contain any number of heads.

What is 'bare repository' in GIT?

A bare Git repository is typically used as a Remote Repository that is sharing a repository among several different people. You don't do work right inside the remote repository so there's no Working Tree (the files in your project that you edit), just bare repository data.

What can you do with Github

A user can use GitHub by the following ways: •Install GIT and create a GitHub account •Create a local GIT repository •Add a new file to the repository •Add a file to the staging environment •Create a commit •Create a new branch


Related study sets

Chapter 31: Care of Patients with Infectious Respiratory Problems Ignatavicius: Medical-Surgical Nursing, 8th Edition - Chapter 27: Lower Respiratory Problems Harding: Lewis's Medical-Surgical Nursing, 11th Edition

View Set

Chapter 10 - Independent Samples t Test

View Set

Anxiety, Obsessive-Compulsive, and Related Disorders, Issues Related to Sexuality

View Set