FAQ: Git Branching - git merge

This community-built FAQ covers the “git merge” exercise from the lesson “Git Branching”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Git

FAQs on the exercise git merge

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Do you have to be in the master before you can merge changes from other branches?

9 Likes

Following up on melissa-d’s question – if I’m on another branch besides “master”, does “branch merge” merge into the current branch, or does it always merge into “master”?

3 Likes

Hi
Regarding: Git Merge

I have a question i have tried the folowing code according to steps but i noticed when i used the git merge fencing command i got the message that Already up-to-date.
Before this git merge fencing command i have used the following command git branch to see my branches.

So i am confused what happened there, following is my code

$ git branch
* fencing
  master
$ git checkout master
M       resume.txt
Switched to branch 'master'
$ git branch
  fencing
* master
$ git merge fencing
Already up-to-date.

Kind Regards

Answer@
git checkout master

i am in the issue of wanting to switch over to master branch from fencing how do i do it

You can enter command line, “git checkout master” .

Hi,
I just moved to the master branch following the codes below:

$ git checkout master
Switched to branch ‘master’
$ git branch
fencing

  • master

Now, I’m going to do the second exercise. I have written the code below:

$ git merge fencing

after running this code the terminal shows me a new page that has a question at the bottom of the page. here is the content:

File /home/ccuser/workspace/peter-pan-resume/.git is being edited (by ccuser with nano 2.5.3, PID 469); continue?
Y Yes
N No ^C Cancel

I expected to merge fencing branch into he master branch. but, it did not. I tried to continue by selecting “Y”.
then another page in terminal comes up which says:
Merge branch ‘fencing’

Please enter a commit message to explain why this merge is necessary,

especially if it merges an updated upstream into a topic branch.

Lines starting with ‘#’ will be ignored, and an empty message aborts

the commit.


Could you please help me with that?