Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.Verify the status of the local repo using git status, everything should be up to date, but nothing has been pushed up to the remote repo

Push the changes to the remote repo git push origin main

Create a branch called feature/the_rev_will_not_be_televised is_happening using the command git checkout -b feature/the_rev_will_not_be_relevisedis_happening

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

...

Code Block
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, commit, and commit push the changes - git add . followed by , git commit -m "Added Winter in America Lyrics", and finally git push origin feature/the_rev_is_happening

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 Goto to your remote repo, refresh the web page, and look for the branches. You should see your branch is now visible.

Back on your machine, switch back to the main branch git checkout main

...

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

Merging changes into main*****

Because we are not working with a remote git repo, we can merge changes from one branch into the current using git merge

...