kea-classrooms / sc-OsamaMansour25

sc-OsamaMansour25 created by GitHub Classroom
0 stars 0 forks source link

Same poem - Now with Issues and PRs #5

Open OsamaMansour25 opened 1 year ago

OsamaMansour25 commented 1 year ago

Let's create the same problem again, but this time use some of the tools on GitHub to solve the problem - let's introduce issues and Pull Requests.

Study this code You've already seen most of it before - what do you think is happening?

Run it!

 git co master
 git pull origin master
 cd $(git root)
 mkdir pr-lab 

 POEM=$(git root)/pr-lab/eeny-meeny-miny-moe.txt

 cat <<ENDOFPOEM > $POEM
 Eeny, meeny, miny, moe,
 Catch a tiger by the toe.
 If he hollers, let him go,
 Eeny, meeny, miny, moe.

 My mother told me to pick 
 the very best one and you - are - it!" 
 ENDOFPOEM

 git add $POEM && git commit -m "I published a poem"
 git tag v01.0.0
 git pull origin master && git push --tags origin master

Always work on an issue

It's an integrated part of the underlying concepts in both Scrum boards and Kanban boards that work only happens for a reason You could say that any change to the code base must be related to a card that is create in forehand. There's always a pupose!

So consequnently - If we want to improive the poem, we first need an issue (task, user story) that instructs us to do so.

So you should go to the webpage on GitHub (gh browse) for this repo and create new issue - assign it to yourself:

 title: "Fix the Eeeny Meeny poem"
 body: "No rules, just improve whatever you like"
 assignee: "@me" 
 label: "bug"
Could have created an issue from the command line? --- Of course: ``` gh issue create \ --title "Fix the Eeeny Meeny poem" \ --body "No rules, just improve whatever you like" \ --assignee "@me" \ --label "bug" ``` - The entire command is one _statement_ but for readability it spawns multiple lines using `\` as line-ending on lines that are _continued_. It returns the URL to the newly created issue image ---

Now create a branch which is specifically related to this particular issue.

image On the icon panel to the left in your VC Code click the GitHub icon. In the lover panel you see the GitHub issues - since you assigned the issue to your selv it should show up - something like:

image

image The Arrow icon will create a new branch, related to this issue.

image The globe will take you to the issue on GitHub in the example (issue 39) the same as gh browse 39.