Module 2 Exercise 3: Wikipedia Switcheroo


(Robert McKenney) #59

As expected, the current working branch - jupiter -shows both planets. The master branch will only have the first one.


(Takeshi Akima) #60

At the end of the steps, readme.md contains the both planets.


(Sanoakira) #61

both paragraph are shown in readme.md.


(Cwoods88keys) #62

On the new branch, readme contains both paragraphs.


(Hammad Mashkoor) #63


(Julia Damerow) #64

New branch has both paragraphs, master has just the first one.


(Dan Cline) #65

I don’t use atom, I use vim and I also pipe output to files :slight_smile:


(Mark Lantsberger) #66

All was smooth today! I like Atom, however the atom . command is not launching the app so you won’t see that in the terminal. Just switched over with the keyboard. My Jupiter branch will have both sets of text and the master would only have Mars in my example.


(Mrculp Mhs) #67

Slowly starting to figure this out. Excuse the extra commands.


(Theportablegeek) #68

The readme.md file shows information about both Planets in the ‘pluto’ branch and just the information about Mercury in the ‘mercury’ branch.


(Ejiga Peter ) #69


(Ejiga Peter ) #70


(Charlotte Morrison) #71

Hello,

I accidentally closed my session- but fortunately I did this in the process of copy/pasting the file to save for later. Here is my file: I replaced the text instead of appending and the master branch showed the original information about Mars, while the branch showed the new information about Mercury.
charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education
$ git init planets
Initialized empty Git repository in D:/git/Git-Education/planets/.git/

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education
$ cd planets

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ touch readme.md

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ git add readme.md

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ git commit -m ‘added info Mars’
[master (root-commit) abcb509] added info Mars
1 file changed, 1 insertion(+)
create mode 100644 readme.md

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ git branch mercury

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ checkout mercury
bash: checkout: command not found

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
$ git checkout mercury
Switched to branch ‘mercury’

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (mercury)
$ vim readme.md

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (mercury)
$ git add readme.md
warning: LF will be replaced by CRLF in readme.md.
The file will have its original line endings in your working directory.

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (mercury)
$ git commit -m ‘changed to mercury’
[mercury 4b8f8b5] changed to mercury
1 file changed, 3 insertions(+), 1 deletion(-)
rewrite readme.md (100%)

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (mercury)
$ cat readme.md
Mercury is the smallest and innermost planet in the Solar System. Its orbital period around the Sun of 87.97 days is the shortest of all the planets in the Solar System. It is named after the Roman deity Mercury, the messenger of the gods.

Like Venus, Mercury orbits the Sun within Earth’s orbit as an inferior planet, and never exceeds 28° away from the Sun. When viewed from Earth, this proximity to the Sun means the planet can only be seen near the western or eastern horizon during the early evening or early morning. At this time it may appear as a bright star-like object, but is often far more difficult to observe than Venus. The planet telescopically displays the complete range of phases, similar to Venus and the Moon, as it moves in its inner orbit relative to Earth, which reoccurs over the so-called synodic period approximately every 116 days.

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (mercury)
$ git checkout master
Switched to branch ‘master’

charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)
cat readme.md Mars is the fourth planet from the Sun and the second-smallest planet in the Solar System after Mercury. In English, Mars carries a name of the Roman god of war, and is often referred to as the "Red Planet"[14][15] because the reddish iron oxide prevalent on its surface gives it a reddish appearance that is distinctive among the astronomical bodies visible to the naked eye.[16] Mars is a terrestrial planet with a thin atmosphere, having surface features reminiscent both of the impact craters of the Moon and the valleys, deserts, and polar ice caps of Earth. charl@LAPTOP-O1D78SLG MINGW64 /d/git/Git-Education/planets (master)


(Andrew Ur) #72

Much like everyone else. I was surprised!
screenshot_84


(Pacomgh) #73

Hi again everybody, how r u?

Here’s my activity screenshot about planets, show the second planet and the deletion first planet :earth_americas:


(Dadremarie) #74

the readme in the new branch (venus) has both paragraphs, but he readme in the master only had one paragraph


(Greg Bernstein) #75

While the git log command shows a fair amount, I also used the git diff across branches to show the changes.
Cheers Greg


(Pumatech) #76

The instructions aren’t super clear, but I assume you want us to show that the different branches contain different contents for the readme.md file (well, that’s what I did anyway…):

This part shows the creation and commitment of a readme with info about Neptune:

This part shows the creation of a second “alt” branch with a readme.md containing info about Mercury and that checking out the different branches shows the different contents of readme.md:


(Boydensuperstar) #77

Shows me second one in the terminal, but my other one is in readme when opened in adam


(Juan Diego Pérez) #78

If the content on the second planet is added to the file

info from both planets is shown.