FAQ: Git Branching - commit on a new branch

This community-built FAQ covers the “commit on a new branch” 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 commit on a new branch

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!


Part 2 of this exercise I could not figure out, deleting one line and inputting another in it’s place using git is the task.

I tried “sed ‘s/Scheme against Captain Hook/Engage in swordfights with pirates/’ resume.txt”

but didn’t work, can anyone help me with this?



Wow this is easy- the question wants you to physically change the lines without having to use git


How to physically change lines if they already seems changed and nothing works! Its is waste of time and no quality outcome from this exercise!
Address: No 31 Kensington Hill Park, London, England
Phone: 000-111-2222

Leader - Lost Boys
Neverland, 5th Star to Right, Straight on 'Til Morning
-Manage Lost Boys
-Consult with Winged Sprites
-Engage in swordfights with pirates


I followed all steps and it did not work as instructed. However when I did it the other way around it worked. You need to review your instructions as they are wrong and do not work and I spent ages trying to resolve it.

1 Like

Correct! However, you should know that the sed command isn’t a git command.

HI, I need help in part 1 in Commin in a new branch. This is the question I’m stuck with 1.

Print the Git commit log.

Notice the output:

  • The commits you see were all made in the master branch. fencing inherited them.
  • This means that every commit master has, fencing also has.

Note : if you find that your cursor is stuck in Git log, press q to escape.

1 Like

Please I need your help

Hi why has master not been changed main already?

Hei Everyone,
I am currently on git branching, i edited the file resume.txt and i already did the previous questions. But the last one asked to commit the change of the file to the repository by adding a message. When i try this: git commit -m "file edited" it doesn’t work. Please how can i accomplish it ?


Hello everyone!!!
When they ask to add the file to the staging area what should I have to do? I write git add resume.txt but still not working. I also tried with git add

Same here - I refreshed my browser and then git add resume.txt worked