Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 4 Next »

Create a new folder called branching and git init it.

Copy the text file six_honest_serving_men.txt from the commits folder.

Git add and commit the changes in the folder.

Create a branch called feature/rev_will_not_be_televised using the command git checkout -b feature/rev_will_not_be_relevised

Add the following lines of text (or something that appeals to you) between the two verses of the original poem

From the Indians who welcomed the pilgrims
  And to the buffalos who once ruled the plain
Like the vultures circling beneath the dark clouds
  Looking for the rain
  Looking for the rain
Just like the cities staggered on the coastline
  In a nation that just can't stand much more
Like the forest buried beneath the highway
  Never had a chance to grow
  Never had a chance to grow

So the poem should look like this

I keep six honest serving-men
  (They taught me all I knew);
Their names are What and Why and When
  And How and Where and Who.
I send them over land and sea,
  I send them east and west;
But after they have worked for me,
  I give them all a rest.

From the Indians who welcomed the pilgrims
  And to the buffalos who once ruled the plain
Like the vultures circling beneath the dark clouds
  Looking for the rain
  Looking for the rain
Just like the cities staggered on the coastline
  In a nation that just can't stand much more
Like the forest buried beneath the highway
  Never had a chance to grow
  Never had a chance to grow
  
I let them rest from nine till five,
  For I am busy then,
As well as breakfast, lunch, and tea,
  For they are hungry men.
But different folk have different views;
  I know a person small
She keeps ten million serving-men,
  Who get no rest at all!
She sends em abroad on her own affairs,
  From the second she opens her eyes
One million Hows, Two million Wheres,
  And seven million Whys!
  
A poem by Rudyard Kipling

Stage and commit the changes - git add . followed by git commit -m "Added Winter in America Lyrics"

If you are using git bash, it should be visible which branch you are on. if you are not using git bash, type git branch to see which branch you are one.

Switch back to the main branch git checkout main

Notice that the text file six_honest_serving_men.txt reverts back to its original state. In actual fact, it hasn’t reverted, it’s simply showing a different truth on a different branch.

It’s good practice the develop of branches and merge those changes into the a branch (typically called known as trunk - main/develop).

Merging changes into main

  • No labels