Module 2 Exercise 3: Wikipedia Switcheroo


(Nbzeman) #21


(Nasseef Abukamail) #22


(JuanMa) #23


(Vanessa) #24

What’s in your .md editor when you open it up now?


(Vanessa) #25

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

Are you on your Saturn branch or Jupiter branch? Why does the readme show both?


(Vanessa) #26

@juanmaguitar nice use of Fork :sparkles:


(Nbzeman) #27

Its the second planet!


(Evan Misshula) #28

This shows both planets because the:
git checkout -b

was done after the first commit.


(Mike Zamansky) #29

Here you go (did wc to show the difference between the branches):


(César Olivares) #30

Both planets are in the README.md file, but if I then checkout master, then only the first planet remains.


(Paola Corrales) #31

Hi! I think it works! :muscle:
When I look the readme.md file from “otherplanet” branch it have two paragraph (Jupiter and Saturn) but when I switch to “master” only have one! :tada:


(Carles Alonso Martinez) #32

It shows the two paragraphs because we are working in second branch


(42bbennett) #33


It merged the two together adding the second planet at the end.


(Amelia Garripoli) #34

This was an interesting exercise in deciding whether to follow the instructions to-the-letter or doing what I thought was the right thing … I opted for the latter, and ended up with the second planet in the file, since I was still in the branch that changed and committed it.

Screenshot (I did a history to show the commands as well, though you can’t see what I did in atom during the session):

The funnest part of this was atom . – I hadn’t thought of starting atom from the command line, and the ability to do that on a directory totally rocked! Atom is quickly replacing notepad++ in my repertoire. I just wish it had a print command…

I noticed the video mentioned a “tree” command (on a mac terminal). Git bash didn’t recognize it, so I’m curious if there’s some other equivalent I could use in that environment?


(Ktheu) #35

In master is only one planet, in the new branch are both


(Vitor Rios) #36

newplanet shows both planets, master shows only the first

Also, @mozzadrella, the exercise’s title is merge, but there is no merge used in the written instructions


(Tess Homan) #37

Because I replaced the information about Earth by the Venus information it only shows the Venus information. If the master is checked out the information of Earth is still there, but not the Venus info.


(Maurício Aniche) #38

In the new branch, shows both. Master currently only has the first planet (Jupiter in my case)


(Alexander L. Hayes) #39

File shows both the first and second paragraph. When we check out a new branch, we bring our commits with us. Since I committed directly on the master branch before switching to “tolstoy” branch, the commits on the master branch came with me.


(Alexander L. Hayes) #40

tree is nice since it shows the structure of folders and subfolders, but git itself should have viable alternatives.

  • git branch --list: shows the local branches.
  • git tag --list: shows the local tags (modules did not cover tagging, but they basically tag a point in history).

If you do want the tree command on your Mac, I found a blog post that outlines the steps. Then you can do tree .git/refs/

Hope this helps! :bat: