Module 2 Exercise 3: Wikipedia Switcheroo


(Mahesh Chugani) #182

The Readme.md file contains information about both planets (Earth & Mars) since the new branch was created AFTER the paragraph about the first planet was committed.


(PEDRO GONZALEZ YANES) #183

I see only the second planet.
We need a merge!

[quote=“mchugani, post:182, topic:25997”]


R the pa
[/quote]


(Asem) #184

It shows both, since the branch was based on the state where we added the paragraph on the first planet.


(Domincl) #185

Contains both planets.

D.


(Phil Schniter) #186

!

On the new branch, readme.md includes both planets. But on the master branch, readme.md includes only the first planet, as expected.


(Irina) #187

Newbranch has both paragraphs in it.


(Lebedevdes) #188



File show entries about both planet.


(Ocrozo) #189

Both entries are keeped.


(Brian Emilius) #190

New branch shows both planets, because the new branch was started with the commit of the first planet.


(Sarah Dukes) #191

@mozzadrella

I definitely did this one wrong, but have no idea how to fix it. I think I should have one paragraph in the first file and two in the second (that seems to be what others got). However, both branches are showing both paragraphs.

In the instructions, it says to make a new readme file for the new branch which I did but there is only ever one file in my planets folder. I looked at what other people have done and my commands are similar. I have no idea where I am going wrong.

Also, I’m really not sure how this activity is connected to the video for this module. It was on the merge command along with pull and fetch but we don’t seem to need to use any of those for this activity. I feel like I am missing something. Help?


(José Luis Raffalli) #192


It shows both because the second branch created is based on the first one.


(José Luis Raffalli) #193

Hey, I would suggest doing a git status to give you more info of what is going on.
I see in your console that it failed to switch back to the master branch. Your Saturn branch should have both paragraph as it shows there.

It is a little tricky to be honest, but the fetch exercise is in activity 2 of module 2. This is act 3 of module 2, to practice branches.

Hope it helps!


(Sarah Dukes) #194

Thank you!

I think I got it working now.

@mozzadrella My output now looks like some of the others in this thread but I am still confused about the connection between this activity and the video for 2.4 Merge. Was I supposed to merge or pull in this activity? I’m also still not sure of the purpose of the fetch command (I asked about it in the Module 2 Exercise 2 thread but haven’t got a reply yet). When/why would I use these?


(Mark Young) #195

See attached an example for a game design course.


(Nasseef Abukamail) #196


(Tigarto) #197

Images:

  1. Create a repository on your desktop called ‘planets’ with a readme.md and commit it.
  2. Choose a Wikipedia page about a planet of your choice.
  3. Copy the first paragraph about the planet, paste it into your readme.md and commit it.
  4. Create a new branch (git branch ) and switch to it (git checkout ).
  5. In atom, add Wikipedia entry about another planet into that branch’s readme.
  6. Save, then commit, then close out of atom.

  1. Does the file show your first planet? Or the second?
  2. Take a screenshot of your output and post it below.


(Cynthia Teeters) #198

The readme.md file has both paragraphs.


(Dominique Charlebois) #199


(Emmanuel M Nimurungi) #200

02


(Mickpmack) #201

It showed the first planet

until I branched and checked it out

I thinkish