πŸ”¨ Software Setup#

πŸ“œ Agenda#

  • Create a GitHub repository.

  • Configure git repository.

  • Install and Configure VS Code

Note

Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.

πŸ’» Procedure#

Create a Repository within the GitHub Classroom#

  1. If you don’t already have a GitHub account, go ahead and create one.

  2. Once you have your account, browse to ECE487 Classroom.

  3. Select Accept this assignment.

  4. Browse to your repository. Note the URL for your repository (save this link; it is the best way to check if your repo is updated).

  5. Go to Settings and change your repository name to ece487-YourLastName, e.g., ece487-baek.

Important

Please name your repository as ece487-LastName. This will help instructors find your repository easily.

Install Git#

  1. To download Git for Windows go to git-scm and click on the link.

  2. Run the setup file and install Git with the default settings. If you have a Mac, you don’t need to do this step because Git is already installed on your computer.

Enable SSH Connection to Your GitHub Account#

Skip this section and go here if you already have set up the SSH connection to your GitHub account.

  1. Open Git Bash and generate a new SSH key, replacing "your_email@example.com" with your actual GitHub email address:

    ssh-keygen -t ed25519 -C "your_email@example.com"
    
  2. When prompted to β€œEnter a file in which to save the key,” hit Enter.

  3. At the prompt for a secure passphrase, press Enter to skip it.

  4. Start the ssh-agent in the background and add your SSH private key to the ssh-agent:

    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_ed25519
    
  5. Display the contents of your public key:

    cat ~/.ssh/id_ed25519.pub
    
  6. Select the output (ensure it include your GitHub email at the end), right click, and select Copy.

  7. Open a web browser and sign in to your GitHub account.

  8. In the upper-right corner, click your profile photo, then click Settings.

    _images/ssh1.png
  9. In the user settings sidebar, click SSH and GPG keys.

    _images/settings-sidebar-ssh-keys.png
  10. Click New SSH key

    _images/ssh-add-ssh-key.png
  11. In the Title field, add a descriptive label for the new key, such as HP830 G7.

  12. Paste your SSH key into the Key field (contents of the .pub file).

  13. Click Add SSH key.

  14. If prompted, confirm your GitHub password.

Clone repository to your computer#

  1. Create a new folder named ece487_wksp in your home directory, e.g., C:\Users\stanley.baek\ece487_wksp.

  2. Right-click on the ece487_wksp folder and select Git Bash Here from the menu.

  3. From the GitHub repository you created in this section, click Clone and copy the command that begins with git clone by clicking on the copy button as shown below.

    _images/GitClone.png
  4. Paste it within the Bash terminal (middle-click, right-click > Paste, or Shift+Ins to paste) and add a space followed by a period as shown below. The period at the end means that the destination is the current folder. Hit Enter.

  5. If it asks for a password, enter the app password you saved in the previous step.

    Note: The gif animation below has been adapted from ECE382. You must use ECE487 in place of ECE382.

    _images/GitClone.gif
  6. The figure below shows an example of a local ece487_wksp folder on your computer.

    _images/workspace_folder.png
  7. Return to the Git Bash terminal. If it’s closed, right-click an empty area inside the ece487_wksp folder and select Git Bash Here from the menu.

  8. Type git remote -v and press Enter. You should see two lines indicating origin is your remote repository on GitHub for both fetching and pushing.

  9. Add the instructor’s repository as another remote source:

    git remote add upstream https://github.com/ECE487/ece487-classroom-ece487_wksp.git
    
  10. Verify the upstream repository has been added by typing git remote -v and press Enter. You should now see two additional lines indicating upstream is the original repository you forked from.

    _images/GitAddUpstream.gif
  11. If the instructor updates the code, you will be notified, and you will need to run git pull upstream main to get the latest updates.

  12. When you push or pull your code, origin will be used by default, which points to your own GitHub repository.

    _images/FetchUpstream.png
    Image is sourced from Stack Overflow

Install and Configure VS Code#

  1. Download Python 3.10.11. Run the file and follow the installation steps. Make sure to check the box that says Add Python to PATH!

  2. Download and install VS Code. Choose the appropriate version for your operating system.

  3. During installation, ensure that you check the last four boxes (see image below) to integrate VS Code with Python and Git.

    _images/VSCode_Setup.png
  4. To open the ece487_wksp folder with VS Code, right-click on the folder and choose Open with Code from the menu.

  5. Open the Show All Commands menu by going to Help or pressing Shift+Ctrl+P. This is a frequently used menu - remember the shortcut Shift+Ctrl+P.

  6. Create a virtual environment for Python typing in the first few letters of Python: Create Environment in the Show All Commands menu and select it.

  7. Choose Venv to create a virtual environment.

  8. Select the Python path that you want to use.

  9. Choose requirements.txt (requirements_linux.txt for Mac or Linux users) to install the Python packages for this course.

  10. Wait for a few minutes until all the packages are installed.

  11. Click the gear icon at the bottom-left corner and select Settings.

  12. Select the workspace tab and click the page icon at the top-right corner. This will open settings.json

  13. Open vscode.md, copy the code inside the curly braces, paste it into settings.json, and save the file. This ensures the virtual environment starts automatically when you open the workspace.

    _images/VirtualEnvSetup.gif

Commit and Push Your Update#

  1. Open README.md and enter your name as the author. Save the file by pressing Ctrl+s.

  2. You should see a number 1 next to the Source Control icon. Click on the icon and type initial commit in the message box, and then click the arrow next to the Commit button. Select Commit & Push from the dropdown menu.

    _images/GitCommitPush.gif
  3. You can accomplish the same steps in Git Bash.

    • Open Git Bash and type

      git add -A
      git commit -m "Initial commit."
      git push
      
    • Press Enter after each command.

    • If prompted, enter your GitHub username and password.

Tip

There are also many third-party graphical user interface (GUI) clients for Git. Explore options at Git-SCM GUIs.

Attention

It is your responsibility to verify that your files have been successfully pushed to your GitHub repository. Always visit your GitHub repository after pushing your assignments to ensure everything is correctly uploaded.

🚚 Deliverables#

Take screenshots of the following and submit them via Gradescope. Use Snip & Sketch (Win+Shift+S) on Windows 10 or Shift+CMD+4 in Mac to capture the screenshots. Save them in png or jpg format.

Warning

Do not take pictures of your computer screen using a mobile device or camera. Doing so will indicate a lack of understanding of sampling aliasing (covered in ECE215 & ECE333), and you will lose 30 points. Yes, I’m serious about this.

Deliverable 1#

  • Push your updates to GitHub

Deliverable 2#

  • Provide a screenshot of your VS Code as shown below. Ensure that the .venv and .vscode folders are visible under the EXPLORER window.

_images/VSCode_Configured.png