A simple assignment to help learners level up on git commands and work flows.
After each step, add your changes, commit and then push to github.
Steps:
-
Create a new direcotry named
git-flowfor your project. Open the directory with Your editor (e.g Visual Studio Code) Initial git in this directory (iegit init) -
In the directory
git-flow, create a new file calledage-calculator.py. In the file typeprint("I will be 100 years old in the year 2080")Save your changes. You can runpython age-calculator.pyto see the result of your code -
Checkout a new branch called
add-nameUpdate your code to look like the followingname = input("What is your name: ") print(name + " will be 100 years old in the year 2080")Save your changes. You can run
python age-calculator.pyto see the result of your code On your github, make a Pull Request (PR) to the master branch. Merge the PR. -
Checkout the master branch (ie on your local machine, switch back to master branch) Pull the origin master. Checkout a new branch called
add-ageUpdate your code to..name = input("What is your name: ") age = int(input("How old are you: ")) print(name + " will be " + age + " years old in the year 2080")Save your changes. You can run
python age-calculator.pyto see the result of your code On your github, make a Pull Request (PR) to the master branch. Merge the PR. -
Checkout the master branch (ie on your local machine, switch back to master branch) Pull the origin master. Checkout a new branch called
add-yearUpdate your code to look like the followingname = input("What is your name: ") age = int(input("How old are you: ")) year = str((2018 - age)+100) print(name + " will be 100 years old in the year " + year)Save your changes. You can run
python age-calculator.pyto see the result of your code On your github, make a Pull Request (PR) to the master branch. Merge the PR.