Code
#!/bin/bash
ssh-keygen -t ed25519 -C "your_email@example.com" # <1>
cat ~/.ssh/id_ed25519.pub # <2>
# Copy the SSh key to your account # <3>
Session 08
December 06 2024 (10:15 am)
In this session, you will work on the following tasks:
city-guide
project.As always:
đź’ˇ You can create a remote repository.
đź’ˇ You can connect your local Git repository to a remote repository service like GitHub or GitLab.
đź’ˇ You can pull and push changes to and from a remote repository.
đź’ˇ You can clone a repository from a remote repository.
city-guide
projectAt the end of this session, you should have accomplished the following:
city-guide
Git repository.main
or master
) of your city-guide
project to GitHub.city-guide
repository.Please keep the city-guide
folder! We will continue to use it in the following sessions.
cat
to print the contents of the SSH key to the command line. Copy the contents displayed in the Terminal to your clipboard.main
or master
) to your remote repository.+
icon in the upper-right corner, then select New repository
. (2) Name your repository. (3) Do not select Initialize this repository with a README
. (4) Click Create repository
.cd
(or a similar path).git remote add origin <URL>
. Remember to use the correct <URL>
depending on whether you authentication method (typically SSH or PAT).main
) to the remote repository using git push -u origin main
.README.md
README.md
, add a brief description, and provide a commit message.README.md
file to the repository.Add file
, and select Create new file
.README.md
. Add a brief description of your project. Provide a descriptive commit message at the bottom.Commit new file
button to save the README.md
file to the repository.git pull origin main
to pull the changes to your local repository.Code
#!/bin/bash
cd /new/location/for/repo # <1>
git clone https://github.com/your-username/your-repo-name.git /new/location/for/repo # <2>
git checkout -b new-branch # <3>
echo "New Recipe" >> recipes.txt # <3>
git add recipes.txt # <3>
git commit -m "Add new recipe to recipes.txt" # <3>
git push -u origin new-branch # <4>
cd /original/location/for/repo # <5>
git fetch # <5>
git switch new-branch # <5>
rm -rf /new/location/for/repo # <6>
cd
in the command line.To print the slides to PDF, do the following:
Note: This feature has been confirmed to work in Google Chrome, Chromium as well as in Firefox.
Here’s what the Chrome print dialog would look like with these settings enabled:
These instructions were copied from the Quarto documentation (MIT License) and slightly modified.
Command | Description |
---|---|
git remote |
Manages remote repositories |
git clone |
Creates a local copy of a repository |
git pull |
Fetches and merges the latest changes from a remote repository into the current branch |
git fetch |
Updates remote tracking branches |
git push |
Uploads local commits to a remote repository |
Dear course participants,
We have a last-minute preparation request for our seminar today (sorry, for the short notice, it will only take a few minutes):
Please ensure you have a working GitHub account before our next session tomorrow. If you do not have one yet, please create an account at https://github.com/. If you need help, check out the section “Creating an account” in the Version Control Book: https://lennartwittkuhn.com/version-control-book/chapters/remotes-intro.html#creating-an-account.
If you encounter any issues or have any questions, feel free to contact us via email.
We look forward to seeing you later!
Best wishes,
Lennart Wittkuhn (Instructor) & Reza Hakimazar (Teaching Assistant)