Skip to content

Commit 63fda12

Browse files
author
Auberon López
committed
Added git instructions
1 parent fda666d commit 63fda12

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

README.md

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,62 @@ This repository gives us a chance to practice using git and virtual environments
2222

2323
## Create a Virtual Environment and Install Dependencies
2424

25-
1. The AdaSay project requires the cowsay package to run. We want to install this dependency in a virtual environment so that it is used only for this project. We first run the following command to create a virtaul environment:
25+
5. The AdaSay project requires the cowsay package to run. We want to install this dependency in a virtual environment so that it is used only for this project. We first run the following command to create a virtaul environment:
2626

2727
```python -m venv venv```
2828

29-
2. This will create a new folder named `venv` which will hold all the information about our virtual environment. Verify that this folder was created by running `ls` and seeing that `venv` is one of the folders present.
29+
6. This will create a new folder named `venv` which will hold all the information about our virtual environment. Verify that this folder was created by running `ls` and seeing that `venv` is one of the folders present.
3030

31-
3. We now need to activate the virtual environment. Everything else up to this point was one-time setup, but we will need to repeat this step each time we open a new terminal to interact with this project. We activate the virtual environment by running the activation script in the `venv` folder.
31+
7. We now need to activate the virtual environment. Everything else up to this point was one-time setup, but we will need to repeat this step each time we open a new terminal to interact with this project. We activate the virtual environment by running the activation script in the `venv` folder.
3232

3333
```source venv/bin/activate```
3434

35-
4. Verify that the virtual environment has been activated. If `(venv)` appears at the front of your shell prompt, you have successfully activated the environment.
35+
8. Verify that the virtual environment has been activated. If `(venv)` appears at the front of your shell prompt, you have successfully activated the environment.
3636

37-
5. Next, we want to install all the requirements. This projects specifies the what packages it needs in the `requirements.txt` file. We use pip to read this file and install the needed dependencies:
37+
9. Next, we want to install all the requirements. This projects specifies the what packages it needs in the `requirements.txt` file. We use pip to read this file and install the needed dependencies:
3838

3939
```pip install -r requirements.txt```
4040

41-
6. Now that the requirements are installed, we're ready to try running our program. Run the following command (in a terminal that has the virtual environment activated) and see if we get a cow outputted:
41+
10. Now that the requirements are installed, we're ready to try running our program. Run the following command (in a terminal that has the virtual environment activated) and see if we get a cow outputted:
4242

4343
```python main.py```
44+
45+
## Make and Commit Changes
46+
47+
11. Right now the cow doesn't say anything interesting. Let's change that! Start by opening VS Code in the AdaSay directory.
48+
49+
```code .```
50+
51+
12. Edit `main.py` to make the cow say something interesting. Make sure to save the file in VS Code after you make your change!
52+
53+
13. Verify that your changes work by running `main.py` again. (Note: if you use the terminal inside VS Code, you may need to activate the virtual environment on that new terminal. See step 7.)
54+
55+
```python main.py```
56+
57+
14. Once you're satisfied with your changes double-check which files have been changed.
58+
59+
```git status```
60+
61+
15. You should expect to see that only `main.py` was changed. We'll now stage this for our commit.
62+
63+
```git add main.py```
64+
65+
16. Check the status of the files again. You should see that `main.py` is now shown in green, indicating that it will be part of our commit.
66+
67+
```git status```
68+
69+
17. Commit the changes. Add some meaningful commit message that describes the changes you made. (Hint: do not use exclamation marks in your commit message)
70+
71+
```git commit -m "Changed cow message to COWABUNGA"```
72+
73+
18. Push the changes to GitHub. If asked for a username and password, use your GitHub username and your Personal Access Token (PAT).
74+
75+
```git push origin```
76+
77+
19. Check that the changes are reflected in GitHub. Refresh the GitHub page in your browser and see that your new change is present in `main.py`.
78+
79+
20. BONUS: do some searching online to figure out how to have cowsay use a dragon instead of a cow. Modify your code to use the dragon, stage your changes, make a commit, and push the commit to GitHub.
80+
81+
21. Once you're finished working on this exercise, deactivate the virtual environment.
82+
83+
```deactivate```

0 commit comments

Comments
 (0)