Question: please help with these git questions I will thumbs up in rating !!! 1) You create a directory on your local computer for a project

please help with these git questions

I will thumbs up in rating !!!

1) You create a directory on your local computer for a project and put some files in it and initialize it as a git repo. Then, you create a repo on GitHub for the project that is initialized with a .gitignore and a README.md. You then attempt to execute the following in a terminal window on the local computer:

git pull origin master

This results in the message, "fatal: refusing to merge unrelated histories".

What do you need to do in order for the pull to work?

A) Remove all tracking of files in the local repo using git rm -r --cached then do the pull. B) Add --rebase to the git pull. C) Remove the .git directory from the project directory on the local computer then do the pull. D) Just execute the same command again and it will work.

2) Development of new features should happen on the master branch.

A) True B) False

3) You are working on a bug fix on a branch called bugfix/memoryleak that you have completed and tested. You want to merge the bug fix into the master branch. Which of the following do you do?

A) While in the bugfix/memoryleak branch, execute git merge master. B) Switch to the master branch using git checkout master, then execute git merge bugfix/memoryleak. C) While in the bugfix/memoryleak branch, execute git pull master. D) Switch to the master branch using git checkout master, then execute git merge master.

4) To create a branch, you run git branch. How can you create a branch and switch to it in one command?

A) git branch --switch B) git checkout -b C) git branch --checkout D) git checkout --create-branch

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!