Git & Forgejo
Pen and paper in pairs
x = 11 y = x print(x, y) x = 11 y = 11 x = 22 print(x, y)
x = [2, 3, 4] y = x print(x, y) x = [2, 3, 4] y = x x = [7, 8, 9] print(x, y) x = [2, 3, 4] y = [2, 3, 4] x[1] = 8 print(x, y) x = [2, 3, 4] y = x x[1] = 8 print(x, y)
Emacs
- start
- stop
C-x C-c - save
C-x C-s - Find the
metakey - The Emacs tutorial
C-h t - The Emacs manual
C-h r - A nice blog posting on one person's experience learning Emacs
- An Emacs Tutorial: Beginner’s Guide to Emacs
- Other resources on Learning Emacs
- Using Emacs and Learning Elisp Series if you like following YouTube videos (I have not viewed them)
Editing our .bashrc file
Now we can use emacs to edit our .bashrc file. Just give the command
emacs and I will talk you through it in class.
git
Introduce yourself to git
git config --global user.email "you@example.com" git config --global user.name "Your Name"
Tell git to name the default branch main
git config --global init.defaultBranch main
git
- Git is a free and open source distributed version control system
- The git reference manual
- A visual git cheat sheet
- Scott Chacon and Ben Straub's book Pro Git gives plenty of background and detail on git, including how to set up your laptop to run git.
- You can find links to many other resources for learning git here. Three that I have found particularly useful are
An example of using git
/home/advprog/days-of-the-year
Sharing a git repo on the advprog Linux server
git init --bare --shared=group /tmp/our-git-repo