Module 2 Exercise 3: Wikipedia Switcheroo


(Steve R Ncl) #43


Both, since we are in the new branch.

Liking atom as an editor by the way. It might even persuade me away from emacs.


(Mark Patterson) #44

(Not entirely sure what you are looking for here.) The readme will show both planets, because the branch checkout occurs after the first planet paragraph is committed.

And a git diff with master showing the changes:

:


(Dirk Uys) #45

The readme contains the info of the second planet - I replaced the contents. Jupiter is the fastest spinning planer in our solar system!

I probably would have made more sense to add the content and not replace it.


(Joachim Francois) #46

End result of the exercise:
On my ‘mars’ branch both the entries (Jupiter and Mars) made are visible in my readme.md file.
When switching to the master branch only the Jupiter entry is shown in my readme.md file.

Screenshot:


(Danny de Vries) #47

The text in the readme is based on which branch you are on. Master in my cases shows pluto but the planet branch shows mars.


(Vanessa) #48

:sparkles::sparkles:


(Vanessa) #49

Was looking for exactly that walkthrough / self assessment :slight_smile:


(Rohith Pudari) #50


(Roberto Martínez Román) #51


(Marco Chiapello) #52

Does the file show your first planet? Or the second?

The README.md files contains both planet’s descriptions.


(Arich.net) #53

Both planet entries are shown :slight_smile:


(Jake Hobbs) #54

Both planets are shown as currently working on the new branch. Reverting back to the master branch (git checkout master) would update the readme in the text editor and only show one planet.

Pasted terminal as screenshot to long…

Jakes-MacBook-Pro:~ jakehobbs$ cd ./Desktop
Jakes-MacBook-Pro:Desktop jakehobbs$ git init planets
Initialized empty Git repository in /Users/jakehobbs/Desktop/planets/.git/
Jakes-MacBook-Pro:Desktop jakehobbs$ cd ./planets
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use “git add” to track)
Jakes-MacBook-Pro:planets jakehobbs$ touch readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch master

Initial commit

Untracked files:
(use “git add …” to include in what will be committed)

readme.md

nothing added to commit but untracked files present (use “git add” to track)
Jakes-MacBook-Pro:planets jakehobbs$ git add readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm --cached …” to unstage)

new file:   readme.md

Jakes-MacBook-Pro:planets jakehobbs$ git commit -m ‘create empty readme’
[master (root-commit) 2337387] create empty readme
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch master
nothing to commit, working tree clean
Jakes-MacBook-Pro:planets jakehobbs$ git log
commit 23373879a15c6c2eb0408cf68b048a3daf6a224a
Author: Jake Hobbs jakehobbs@hotmail.co.uk
Date: Fri Jun 15 12:15:51 2018 +0100

create empty readme

Jakes-MacBook-Pro:planets jakehobbs$ brackets readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch master
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

modified:   readme.md

no changes added to commit (use “git add” and/or “git commit -a”)
Jakes-MacBook-Pro:planets jakehobbs$ git add readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git commit -m ‘add uranus info’
[master e5c6a1c] add uranus info
1 file changed, 3 insertions(+)
Jakes-MacBook-Pro:planets jakehobbs$ git branch saturn
Jakes-MacBook-Pro:planets jakehobbs$ git checkout saturn
Switched to branch ‘saturn’
Jakes-MacBook-Pro:planets jakehobbs$ git status
On branch saturn
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

modified:   readme.md

no changes added to commit (use “git add” and/or “git commit -a”)
Jakes-MacBook-Pro:planets jakehobbs$ git add readme.md
Jakes-MacBook-Pro:planets jakehobbs$ git commit
[saturn 6ad82f5] ‘update readme with staturn info’
1 file changed, 7 insertions(+), 1 deletion(-)
Jakes-MacBook-Pro:planets jakehobbs$


(Isara Naranirattisai) #55

Here’s my screenshots



(Fernanda Ochoa) #56

Hi, this are my screenshots, and show both planets, because the Branch contains the master base content, if I do a checkout to master only can shows one of them.




(Dr. Ayaz H. Khan) #57


(Ygor Canalli) #58

It shows both! :slight_smile:


(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.